Fix std::list splice usage error

This commit is contained in:
Liu Jiaming 2014-12-02 15:22:11 +08:00 committed by Dennis Luxen
parent 725b93a961
commit 1d2f06df6d

View File

@ -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;
}