From: aaronsw Date: Thu, 28 Nov 2002 19:44:30 +0000 (+0000) Subject: oops, another buglet X-Git-Url: https://git.mxchange.org/?p=quix0rs-apt-p2p.git;a=commitdiff_plain;h=c71cfbb7bc121247bcb2629713d700bfe4e0fedb oops, another buglet --- diff --git a/ktable.py b/ktable.py index 5a906fa..2f1cf31 100644 --- a/ktable.py +++ b/ktable.py @@ -40,8 +40,12 @@ class KTable: i = self._bucketIndexForInt(int) # if this node is already in our table then return it - if int in self.buckets[i].l: return [int] - + try: + index = self.buckets[i].l.index(int) + except ValueError: + pass + else: + return [self.buckets[i].l[index]] nodes = nodes + self.buckets[i].l if len(nodes) < K: # need more nodes