shared_cache: use a single lookup for lookup() too

We didn't convert this one to use iterators before.

Signed-off-by: Greg Farnum <greg@inktank.com>
This commit is contained in:
Greg Farnum 2014-01-30 13:47:22 -08:00 committed by Somnath Roy
parent cec40dae17
commit f6771f2004

View File

@ -153,8 +153,9 @@ public:
bool retry = false;
do {
retry = false;
if (weak_refs.count(key)) {
val = weak_refs[key].lock();
typename map<K, WeakVPtr>::iterator i = weak_refs.find(key);
if (i != weak_refs.end()) {
val = i->second.lock();
if (val) {
lru_add(key, val, &to_release);
} else {