We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b47d16 commit 870b4c2Copy full SHA for 870b4c2
LRUCache.h
@@ -26,7 +26,6 @@ class LRUCache{
26
int get(int key){
27
if (cachemap.find(key) != cachemap.end()) {
28
cachelist.splice(cachelist.begin(), cachelist, cachemap[key]);
29
- cachemap[key] = cachelist.begin();
30
return cachemap[key]->value;
31
}
32
else {
@@ -37,7 +36,6 @@ class LRUCache{
37
36
void set(int key, int value) {
38
39
40
41
cachemap[key]->value = value;
42
43
0 commit comments