summaryrefslogtreecommitdiffstats
path: root/vespalib/src/tests/detect_type_benchmark
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@oath.com>2020-09-25 10:30:41 +0000
committerHåvard Pettersen <havardpe@oath.com>2020-09-25 10:30:41 +0000
commita2cfeb42a27c65b75aca1fad5aa795a2f8c5e1c2 (patch)
treee0169ee89c07937392977b883cc0362081e68ba3 /vespalib/src/tests/detect_type_benchmark
parent929128a2e44bc55d56202a252527107b786a13f3 (diff)
inline typeid(A)
Diffstat (limited to 'vespalib/src/tests/detect_type_benchmark')
-rw-r--r--vespalib/src/tests/detect_type_benchmark/detect_type_benchmark.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/vespalib/src/tests/detect_type_benchmark/detect_type_benchmark.cpp b/vespalib/src/tests/detect_type_benchmark/detect_type_benchmark.cpp
index 44e15de2399..6d178093069 100644
--- a/vespalib/src/tests/detect_type_benchmark/detect_type_benchmark.cpp
+++ b/vespalib/src/tests/detect_type_benchmark/detect_type_benchmark.cpp
@@ -66,7 +66,6 @@ A a;
B b;
Nop nop;
double baseline = 0.0;
-const auto &typeid_A = typeid(A);
//-----------------------------------------------------------------------------
@@ -89,12 +88,12 @@ bool use_dynamic_cast(const BaseClass *ptr) {
bool use_type_index(const BaseClass *) __attribute__((noinline));
bool use_type_index(const BaseClass *ptr) {
- return (std::type_index(typeid(*ptr)) == std::type_index(typeid_A));
+ return (std::type_index(typeid(*ptr)) == std::type_index(typeid(A)));
}
bool use_type_id(const BaseClass *) __attribute__((noinline));
bool use_type_id(const BaseClass *ptr) {
- return (typeid(*ptr) == typeid_A);
+ return (typeid(*ptr) == typeid(A));
}
bool use_dynamic_id(const BaseClass *) __attribute__((noinline));