[PATCH] [Clang Tidy]: Use shrink_to_fit instead of copy and swap trick.

Alexander Kornienko alexfh at google.com
Fri Jan 23 07:02:22 PST 2015


================
Comment at: test/clang-tidy/readability-shrink-to-fit.cpp:48
@@ +47,3 @@
+
+template <typename T> void g2() {
+  T v2;
----------------
alexfh wrote:
> Any reason for this to be a separate function? Why not just add a test with v2 to g<>?
Ah, I get it. No need to address this ;)

================
Comment at: test/clang-tidy/readability-shrink-to-fit.cpp:67
@@ +66,3 @@
+  g<bool>();
+  g2<std::vector<int> >();
+  std::vector<int> v;
----------------
alexfh wrote:
> nit: In C++11 you don't need to put a space here.
I'll fix it myself and commit the patch.

http://reviews.llvm.org/D7087

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






More information about the cfe-commits mailing list