Formatting based on review

This commit is contained in:
Peter Šurda 2019-07-11 15:32:00 +02:00
parent 465a276c02
commit 0eb4f46923
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -122,12 +122,14 @@ class Dandelion():
def expire(self): def expire(self):
with self.lock: with self.lock:
deadline = time() deadline = time()
toDelete = [[v.stream, k, v.child] toDelete = [
for k, v in self.hashMap.iteritems() [v.stream, k, v.child] for k, v in self.hashMap.iteritems()
if v.timeout < deadline] if v.timeout < deadline
]
for row in toDelete: for row in toDelete:
self.removeHash(row[1], 'expiration') self.removeHash(row[1], 'expiration')
invQueue.put((row[0], row[1], row[2])) invQueue.put(row)
return toDelete return toDelete
def reRandomiseStems(self): def reRandomiseStems(self):