Skip to content

Commit e0a080d

Browse files
committed
BenchmarkFamilies::FindBenchmarks(): correctly use std::vector<>::reserve()
It takes the whole total new capacity, not the increase.
1 parent a54ef37 commit e0a080d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/benchmark_register.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ bool BenchmarkFamilies::FindBenchmarks(
150150
}
151151
// reserve in the special case the regex ".", since we know the final
152152
// family size.
153-
if (spec == ".") benchmarks->reserve(family_size);
153+
if (spec == ".") benchmarks->reserve(benchmarks->size() + family_size);
154154

155155
for (auto const& args : family->args_) {
156156
for (int num_threads : *thread_counts) {

0 commit comments

Comments
 (0)