benchmark.cc: Fix benchmarks_with_threads condition (#1651)

Change condition for `benchmarks_with_threads` from `benchmark.threads() > 0` to `> 1`.  `threads()` appears to always be `>= 1`.

Introduced in fbc6efa (Refactoring of PerfCounters infrastructure (#1559))
This commit is contained in:
Jesse Rosenstock 2023-08-17 16:41:17 +02:00 committed by GitHub
parent aa59d40f88
commit 885e9f71d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -383,7 +383,7 @@ void RunBenchmarks(const std::vector<BenchmarkInstance>& benchmarks,
BenchmarkReporter::PerFamilyRunReports* reports_for_family = nullptr; BenchmarkReporter::PerFamilyRunReports* reports_for_family = nullptr;
if (benchmark.complexity() != oNone) if (benchmark.complexity() != oNone)
reports_for_family = &per_family_reports[benchmark.family_index()]; reports_for_family = &per_family_reports[benchmark.family_index()];
benchmarks_with_threads += (benchmark.threads() > 0); benchmarks_with_threads += (benchmark.threads() > 1);
runners.emplace_back(benchmark, &perfcounters, reports_for_family); runners.emplace_back(benchmark, &perfcounters, reports_for_family);
int num_repeats_of_this_instance = runners.back().GetNumRepeats(); int num_repeats_of_this_instance = runners.back().GetNumRepeats();
num_repetitions_total += num_repeats_of_this_instance; num_repetitions_total += num_repeats_of_this_instance;