summaryrefslogtreecommitdiff
path: root/src/common/lru_map.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/lru_map.h')
-rw-r--r--src/common/lru_map.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/common/lru_map.h b/src/common/lru_map.h
index 62182dd26e8..98fb44a932e 100644
--- a/src/common/lru_map.h
+++ b/src/common/lru_map.h
@@ -24,7 +24,7 @@ public:
class UpdateContext {
public:
virtual ~UpdateContext() {}
- virtual void update(V& v) = 0;
+ virtual bool update(V& v) = 0;
};
bool _find(const K& key, V *value, UpdateContext *ctx);
@@ -51,8 +51,10 @@ bool lru_map<K, V>::_find(const K& key, V *value, UpdateContext *ctx)
entry& e = iter->second;
entries_lru.erase(e.lru_iter);
+ bool r = true;
+
if (ctx)
- ctx->update(e.value);
+ r = ctx->update(e.value);
if (value)
*value = e.value;
@@ -60,7 +62,7 @@ bool lru_map<K, V>::_find(const K& key, V *value, UpdateContext *ctx)
entries_lru.push_front(key);
e.lru_iter = entries_lru.begin();
- return true;
+ return r;
}
template <class K, class V>