From ae9c7b861b257897a7ff0044d38e70f95df3eec7 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 29 Apr 2022 13:39:04 -0600 Subject: [PATCH] [benchmark-set] At least increase needle by one in lookup benchmark --- perf/benchmark-set.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perf/benchmark-set.cc b/perf/benchmark-set.cc index 58884e84e..82266486d 100644 --- a/perf/benchmark-set.cc +++ b/perf/benchmark-set.cc @@ -85,7 +85,7 @@ static void BM_SetLookup(benchmark::State& state) { auto needle = max_value / 2; for (auto _ : state) { benchmark::DoNotOptimize( - hb_set_has (original, needle++)); + hb_set_has (original, needle++ % max_value)); } hb_set_destroy(original);