[PATCH] D16152: [clang-tidy] Add check performance-faster-string-find

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 14 06:48:46 PST 2016


aaron.ballman added a subscriber: aaron.ballman.
aaron.ballman added a reviewer: aaron.ballman.

================
Comment at: clang-tidy/performance/FasterStringFindCheck.cpp:25
@@ +24,3 @@
+  SmallVector<StringRef, 4> Classes;
+  Option.split(Classes, ",");
+  return std::vector<std::string>(Classes.begin(), Classes.end());
----------------
It might be nice for this to be more tolerant of whitespace around the commas.

================
Comment at: clang-tidy/performance/FasterStringFindCheck.cpp:47
@@ +46,3 @@
+void FasterStringFindCheck::registerMatchers(MatchFinder *Finder) {
+  const auto SingleChar =
+      expr(ignoringParenCasts(stringLiteral(lengthIsOne()).bind("literal")));
----------------
Can you also disable registration of these matches outside of C++ mode?


http://reviews.llvm.org/D16152





More information about the cfe-commits mailing list