diff options
author | Ask Solem <ask@celeryproject.org> | 2012-11-27 15:48:42 +0000 |
---|---|---|
committer | Ask Solem <ask@celeryproject.org> | 2012-11-27 15:48:42 +0000 |
commit | f68f8ac8c0808c6c33f3c4cbab7c7932e1ccd48d (patch) | |
tree | a4ec01bc6f13bb11ece248c5384103c76f3bc22b /kombu/clocks.py | |
parent | 325fcc0522571096b424080c232f0d87a1e5865e (diff) | |
parent | 6b77885cf0e26b0f08a38db08835e8e43cd3ae91 (diff) | |
download | kombu-f68f8ac8c0808c6c33f3c4cbab7c7932e1ccd48d.tar.gz |
Merge branch 'master' into 3.0
Conflicts:
kombu/abstract.py
kombu/clocks.py
kombu/messaging.py
kombu/pidbox.py
kombu/pools.py
kombu/tests/mocks.py
kombu/tests/test_common.py
kombu/tests/test_messaging.py
kombu/tests/test_serialization.py
kombu/tests/test_utils.py
kombu/tests/transport/test_redis.py
kombu/tests/utilities/test_encoding.py
kombu/transport/pika.py
kombu/transport/zmq.py
kombu/transport/zookeeper.py
kombu/utils/__init__.py
kombu/utils/encoding.py
kombu/utils/finalize.py
pavement.py
requirements/default.txt
Diffstat (limited to 'kombu/clocks.py')
-rw-r--r-- | kombu/clocks.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/kombu/clocks.py b/kombu/clocks.py index 1afff225..8d85bf21 100644 --- a/kombu/clocks.py +++ b/kombu/clocks.py @@ -4,9 +4,6 @@ kombu.clocks Logical Clocks and Synchronization. -:copyright: (c) 2009 - 2012 by Ask Solem. -:license: BSD, see LICENSE for more details. - """ from __future__ import absolute_import @@ -71,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, @@ -89,13 +83,13 @@ class LamportClock(object): """ if h[0][0] == h[1][0]: same = [] - for i, PN in zip(h, islice(h, 1, None)): + for PN in zip(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): |