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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 14 09:38:12 PST 2016


aaron.ballman added inline comments.

================
Comment at: clang-tidy/performance/FasterStringFindCheck.cpp:29
@@ +28,3 @@
+    Class = Class.trim();
+  return std::vector<std::string>(Classes.begin(), Classes.end());
+}
----------------
I think hasName() will assert if given an empty string, so this should probably also guard against a class list like ",basic_string".

================
Comment at: test/clang-tidy/performance-faster-string-find.cpp:9
@@ +8,3 @@
+struct basic_string {
+  int find(const Char *, int = 0) const;
+  int find(const Char *, int, int) const;
----------------
> Should we move stubs to a common header(s)?

Yes, please. However, that can be a separate patch that does something more comprehensive.


http://reviews.llvm.org/D16152





More information about the cfe-commits mailing list