diff options
author | Henning Baldersheim <balder@oath.com> | 2018-10-27 11:19:13 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@oath.com> | 2018-11-01 15:14:38 +0100 |
commit | d31a1b7f2df4ea94821a9d98754f4ae186bbf2d8 (patch) | |
tree | 75515a07b65e9225ac3a43f7830d825e5cbb916d /vespalib/src/tests | |
parent | c3982d42b9d5ca9aea7600f5bc5fc6cceb78505a (diff) |
Use a templated find() to enable lookup without object creation when objects are comparable.
Diffstat (limited to 'vespalib/src/tests')
-rw-r--r-- | vespalib/src/tests/stllike/hash_test.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vespalib/src/tests/stllike/hash_test.cpp b/vespalib/src/tests/stllike/hash_test.cpp index e7fe729c1ba..4feeaef8349 100644 --- a/vespalib/src/tests/stllike/hash_test.cpp +++ b/vespalib/src/tests/stllike/hash_test.cpp @@ -154,14 +154,14 @@ TEST("test hash set with simple type") TEST("test hash map iterator stability") { - hash_map<int, int> h; + hash_map<uint32_t, uint32_t> h; EXPECT_EQUAL(1ul, h.capacity()); for (size_t i(0); i < 100; i++) { EXPECT_TRUE(h.find(i) == h.end()); h[i] = i; EXPECT_TRUE(h.find(i) != h.end()); - int * p1 = & h.find(i)->second; - int * p2 = & h[i]; + uint32_t * p1 = & h.find(i)->second; + uint32_t * p2 = & h[i]; EXPECT_EQUAL(p1, p2); } EXPECT_EQUAL(128ul, h.capacity()); |