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

Alexander Kornienko alexfh at google.com
Fri Jan 23 06:50:58 PST 2015


Looks good with a couple of nits. See the comments.


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

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

http://reviews.llvm.org/D7087

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






More information about the cfe-commits mailing list