From c71cfbb7bc121247bcb2629713d700bfe4e0fedb Mon Sep 17 00:00:00 2001 From: aaronsw Date: Thu, 28 Nov 2002 19:44:30 +0000 Subject: [PATCH] oops, another buglet --- ktable.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 -- 2.39.5