mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-11 01:41:57 -04:00
lrucache: remove unneeded move_to_end call, already at end
This commit is contained in:
parent
9b89f3ebd4
commit
211bb3225c
1 changed files with 1 additions and 2 deletions
|
|
@ -30,8 +30,7 @@ class LRUCache(MutableMapping[K, V]):
|
|||
), "Unexpected attempt to replace a cached item without first deleting the old item."
|
||||
while len(self._cache) >= self._capacity:
|
||||
self._dispose(self._cache.popitem(last=False)[1])
|
||||
self._cache[key] = value
|
||||
self._cache.move_to_end(key)
|
||||
self._cache[key] = value # add new entry at the end
|
||||
|
||||
def __getitem__(self, key: K) -> V:
|
||||
self._cache.move_to_end(key) # raise KeyError if not found
|
||||
|
|
|
|||
Loading…
Reference in a new issue