Fix std::list splice usage error
This commit is contained in:
parent
725b93a961
commit
1d2f06df6d
@ -86,7 +86,7 @@ template <typename KeyT, typename ValueT> class LRUCache
|
||||
result = e.value;
|
||||
|
||||
// move to front
|
||||
itemsInCache.splice(positionMap.find(key)->second, itemsInCache, itemsInCache.begin());
|
||||
itemsInCache.splice(itemsInCache.begin(), itemsInCache, positionMap.find(key)->second);
|
||||
positionMap.find(key)->second = itemsInCache.begin();
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user