[PATCH] [clang-tidy] Checker for inefficient use of algorithms on associative containers

Alexander Kornienko alexfh at google.com
Thu Feb 12 06:57:25 PST 2015


================
Comment at: clang-tidy/misc/InefficientAlgorithmCheck.cpp:22
@@ +21,3 @@
+  const std::string Algorithms =
+      "std::(find|count|equal_range|lower_blound|upper_bound)";
+  const auto ContainerMatcher = classTemplateSpecializationDecl(
----------------
This turns out to match std::count_if/std::find_if as well. Could you surround the regex with ^$ and add a test? Same applies to the ContainerMatcher below.

http://reviews.llvm.org/D7246

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list