[PATCH] D20196: [clang-tidy] Inefficient string operation

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Wed May 18 07:09:51 PDT 2016


alexfh added a comment.

Please create a diff with the full context: http://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface


================
Comment at: clang-tidy/performance/InefficientStringAdditionCheck.cpp:84
@@ +83,3 @@
+  const auto DiagMsg =
+      "Inefficient string concatenation, use operator+= or "
+      "std::basic_string::append instead";
----------------
nit: Warning messages are not full sentences, so they should not start with a capital letter and should not end with a period.

Please also change the comma to a semicolon `;`.

================
Comment at: clang-tidy/performance/InefficientStringAdditionCheck.cpp:85
@@ +84,3 @@
+      "Inefficient string concatenation, use operator+= or "
+      "std::basic_string::append instead";
+
----------------
`std::basic_string::append` is correct, but is an unnecessary detail. I'd suggest changing this to `string::append` or to just `append()`.


http://reviews.llvm.org/D20196





More information about the cfe-commits mailing list