summaryrefslogtreecommitdiff
path: root/kombu/clocks.py
diff options
context:
space:
mode:
authorAsk Solem <ask@celeryproject.org>2012-11-22 17:39:35 +0000
committerAsk Solem <ask@celeryproject.org>2012-11-22 17:39:35 +0000
commitde77fe7f42f9df523209d8224d5840f1639a1105 (patch)
tree34f79cdecc4922b256d71b73ea0c044ed33b6a1c /kombu/clocks.py
parentda4eecab32057db1d6fac3824e458fdf8691a00a (diff)
downloadkombu-de77fe7f42f9df523209d8224d5840f1639a1105.tar.gz
Test improvements
Diffstat (limited to 'kombu/clocks.py')
-rw-r--r--kombu/clocks.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/kombu/clocks.py b/kombu/clocks.py
index 8086521f..e9419cde 100644
--- a/kombu/clocks.py
+++ b/kombu/clocks.py
@@ -68,9 +68,6 @@ class LamportClock(object):
self.value += 1
return self.value
- def sort(self, d):
- return d[sorted(d)[0]]
-
def sort_heap(self, h):
"""List of tuples containing at least two elements, representing
an event, where the first element is the event's scalar clock value,
@@ -86,13 +83,13 @@ class LamportClock(object):
"""
if h[0][0] == h[1][0]:
same = []
- for i, PN in izip(h, islice(h, 1, None)):
+ for PN in izip(h, islice(h, 1, None)):
if PN[0][0] != PN[1][0]:
break # Prev and Next's clocks differ
same.append(PN[0])
# return first item sorted by process id
return sorted(same, key=lambda event: event[1])[0]
- # all clock values unique, return first item
+ # clock values unique, return first item
return h[0]
def __str__(self):