add reserve() call when inserting lists of values with random access iterators.

This commit is contained in:
greg
2020-07-28 10:44:22 -04:00
parent c818e86a99
commit 0c6e8c3208
2 changed files with 34 additions and 9 deletions
+1 -1
View File
@@ -86,7 +86,7 @@ void test(const char *name, Perturb perturb1, Perturb perturb2)
Timer t(name); // start timer
Set c;
c.reserve(order.size()); // whether this "reserve()" is present or not makes a huge difference
//c.reserve(order.size()); // whether this "reserve()" is present or not makes a huge difference
c.insert(order.begin(), order.end()); // time for inserting the same keys into the set
// should not depend on them being sorted or not.
}