Skip to content

Commit 0212187

Browse files
author
MarcoFalke
committed
Merge #13598: bench: fix incorrect behaviour in prevector.cpp
1fc605a fix bench/prevector.cpp (Akio Nakamura) Pull request description: This patch intends to fix some incorrect action of bench/prevector.cpp. 1. PrevectorClear() 2nd call of ```clear()``` should to operate t1 instead of t0. This patch changes t0 to t1. 2. PREVECTOR_TEST() PREVECTOR_TEST macro should to call both ```PrevectorXX<nontrivial_t>(state)``` and ```PrevectorXX<trivial_t>(state)``` by specific ```"name"``` which given by parameter instead of calling ```PrevectorResize<>()``` regardless of ```"name"```. This patch changes ```"PrevectorResize<"``` of this macro to ```"Prevector ## name<"```. Tree-SHA512: d0498c6d627d7e96fc8ccfb329ca0be2641535b1ce1923d9b1fc720825f9bf4d7281dc8d5ae929038e37b3e625189af9807cb62e6d20933d73832a6dff4b5596
2 parents 287e4ed + 1fc605a commit 0212187

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bench/prevector.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static void PrevectorClear(benchmark::State& state)
4242
t0.resize(28);
4343
t0.clear();
4444
t1.resize(29);
45-
t0.clear();
45+
t1.clear();
4646
}
4747
}
4848
}
@@ -64,11 +64,11 @@ static void PrevectorResize(benchmark::State& state)
6464

6565
#define PREVECTOR_TEST(name, nontrivops, trivops) \
6666
static void Prevector ## name ## Nontrivial(benchmark::State& state) { \
67-
PrevectorResize<nontrivial_t>(state); \
67+
Prevector ## name<nontrivial_t>(state); \
6868
} \
6969
BENCHMARK(Prevector ## name ## Nontrivial, nontrivops); \
7070
static void Prevector ## name ## Trivial(benchmark::State& state) { \
71-
PrevectorResize<trivial_t>(state); \
71+
Prevector ## name<trivial_t>(state); \
7272
} \
7373
BENCHMARK(Prevector ## name ## Trivial, trivops);
7474

0 commit comments

Comments
 (0)