Skip to content

Commit ab4158f

Browse files
Ravi Nagarjun AkellaRavi Nagarjun Akella
authored andcommitted
remove failed keys
1 parent bc40a3b commit ab4158f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

include/sisl/cache/simple_cache.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ class SimpleCache {
6363
}
6464
t_evicted_keys.clear();
6565
}
66+
67+
// erase failed keys
68+
if (t_failed_keys.size() > 0) {
69+
for (const auto& key : t_failed_keys) {
70+
V out_val;
71+
m_map.erase(key, out_val);
72+
}
73+
t_failed_keys.clear();
74+
}
6675
return ret;
6776
}
6877

0 commit comments

Comments
 (0)