Skip to content
Commit e94b7c24 authored by Alexander Kornienko's avatar Alexander Kornienko
Browse files

[clang-tidy] Use shrink_to_fit instead of copy and swap trick

The shrink_to_fit() method is more readable and more effective than
the copy and swap trick to reduce the capacity of a shrinkable container.
Note that, the shrink_to_fit() method is only available in C++11 and up.

Example:

std::vector<int>(v).swap(v); will be replaced with v.shrink_to_fit();

http://reviews.llvm.org/D7087

Patch by Gábor Horváth!

llvm-svn: 226912
parent a6354cae
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment