mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 19:22:45 +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):
|
def __len__(self):
|
||||||
# No dependency on utils.iter
|
# No dependency on utils.iter
|
||||||
# return ilen(self)
|
# return ilen(self)
|
||||||
i = 0
|
self._clearOldElements()
|
||||||
for _ in self:
|
return len(self.queue)
|
||||||
i += 1
|
|
||||||
return i
|
|
||||||
|
|
||||||
class MaxLengthQueue(queue):
|
class MaxLengthQueue(queue):
|
||||||
__slots__ = ('length',)
|
__slots__ = ('length',)
|
||||||
|
Loading…
Reference in New Issue
Block a user