mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
Simplified the implementation of structures.TimeoutQueue.
This commit is contained in:
parent
b39eaa7cb5
commit
ecca13ec11
@ -347,10 +347,8 @@ class TimeoutQueue(object):
|
||||
def __len__(self):
|
||||
# No dependency on utils.iter
|
||||
# return ilen(self)
|
||||
i = 0
|
||||
for _ in self:
|
||||
i += 1
|
||||
return i
|
||||
self._clearOldElements()
|
||||
return len(self.queue)
|
||||
|
||||
class MaxLengthQueue(queue):
|
||||
__slots__ = ('length',)
|
||||
|
Loading…
Reference in New Issue
Block a user