aboutsummaryrefslogtreecommitdiffstats
path: root/staging_vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-12-22 11:42:46 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2017-12-28 19:14:23 +0100
commit392f7fc95a9b558eca1c4c3c3f8ff690de363aaf (patch)
treee847762c8aee8dfee47f047c2b2947a00547309e /staging_vespalib
parent7192d872ef68b7a0588e7f5710ff49350c6863fb (diff)
Must generate the hash before the object is invalid
Diffstat (limited to 'staging_vespalib')
-rw-r--r--staging_vespalib/src/vespa/vespalib/stllike/lrucache_map.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/staging_vespalib/src/vespa/vespalib/stllike/lrucache_map.hpp b/staging_vespalib/src/vespa/vespalib/stllike/lrucache_map.hpp
index dfa21e12137..61147229497 100644
--- a/staging_vespalib/src/vespa/vespalib/stllike/lrucache_map.hpp
+++ b/staging_vespalib/src/vespa/vespalib/stllike/lrucache_map.hpp
@@ -110,6 +110,7 @@ void
lrucache_map<P>::erase(const K & key) {
internal_iterator it = HashTable::find(key);
if (it != HashTable::end()) {
+ next_t h = HashTable::hash(key);
onRemove(key);
LV & v = it->second;
if (v._prev != LinkedValueBase::npos) {
@@ -122,7 +123,7 @@ lrucache_map<P>::erase(const K & key) {
} else {
_tail = v._prev;
}
- HashTable::erase(*this, HashTable::hash(key), it);
+ HashTable::erase(*this, h, it);
}
}