Simplified the implementation of structures.TimeoutQueue.

This commit is contained in:
Jeremy Fincher 2005-03-09 07:28:09 +00:00
parent b39eaa7cb5
commit ecca13ec11

View File

@ -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',)