BenchmarkFamilies::FindBenchmarks(): correctly use std::vector<>::reserve()

It takes the whole total new capacity, not the increase.
This commit is contained in:
Roman Lebedev 2021-06-02 13:28:05 +03:00
parent a54ef37aea
commit e0a080d00e
No known key found for this signature in database
GPG Key ID: 083C3EBB4A1689E0
1 changed files with 1 additions and 1 deletions

View File

@ -150,7 +150,7 @@ bool BenchmarkFamilies::FindBenchmarks(
}
// reserve in the special case the regex ".", since we know the final
// family size.
if (spec == ".") benchmarks->reserve(family_size);
if (spec == ".") benchmarks->reserve(benchmarks->size() + family_size);
for (auto const& args : family->args_) {
for (int num_threads : *thread_counts) {