use shrink_to_fit() instead of swap trick
This commit is contained in:
@@ -41,7 +41,7 @@ template <typename T> inline void sort_unique_resize(std::vector<T> &vector)
|
||||
template <typename T> inline void sort_unique_resize_shrink_vector(std::vector<T> &vector)
|
||||
{
|
||||
sort_unique_resize(vector);
|
||||
std::vector<T>().swap(vector);
|
||||
vector.shrink_to_fit();
|
||||
}
|
||||
|
||||
template <typename T> inline void remove_consecutive_duplicates_from_vector(std::vector<T> &vector)
|
||||
|
||||
Reference in New Issue
Block a user