[PATCH] D105734: [clang-tidy] performance-unnecessary-copy-initialization: Do not remove comments on new lines.

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 12 11:11:03 PDT 2021


ymandel accepted this revision.
ymandel added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:50
+  size_t Offset = std::strcspn(TextAfter, "\n");
+  return Loc.getLocWithOffset(TextAfter[Offset] != '\0' ? Offset + 1 : Offset);
+}
----------------
optional nit: invert the condition and the branches. i just find it a little easier to read positive predicates. So, when i have both branches, I try for the condition to be positive (or, in other words, I try not to not the condition. ;) )


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105734/new/

https://reviews.llvm.org/D105734



More information about the cfe-commits mailing list