This commit is contained in:
2021-01-07 20:37:43 +08:00
parent 30ab499d41
commit 27413613bd
5 changed files with 144 additions and 13 deletions

View File

@@ -91,6 +91,16 @@ class HashEntries:
r.append(i)
return r
def has(self, d: HashEntry) -> bool:
if d.hash is None or d.id is None:
return False
for v in self.__list:
if v.hash == d.hash and v.id == d.id:
if d.time > v.time:
v.time = d.time
return True
return False
def setMaxCount(self, maxCount: int):
self.__maxCount = maxCount if maxCount >= 1 else 100
self.__removeMax()