set maxlen

This commit is contained in:
Jack Robison 2022-08-26 11:38:56 -04:00
parent 99e1006cb5
commit 579f95f9fc
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -522,7 +522,7 @@ class LargestValueCache:
def __init__(self, capacity: int): def __init__(self, capacity: int):
self._capacity = max(capacity, 0) self._capacity = max(capacity, 0)
self._cache = {} self._cache = {}
self._raw_cache: Deque[LargestValueCacheItem] = deque() self._raw_cache: Deque[LargestValueCacheItem] = deque(maxlen=capacity)
def items(self): def items(self):
return self._cache.items() return self._cache.items()