]> git.mxchange.org Git - quix0rs-apt-p2p.git/commitdiff
oops, another buglet
authoraaronsw <aaronsw>
Thu, 28 Nov 2002 19:44:30 +0000 (19:44 +0000)
committeraaronsw <aaronsw>
Thu, 28 Nov 2002 19:44:30 +0000 (19:44 +0000)
ktable.py

index 5a906fa235b2ed624545cef2b93367eb6245addd..2f1cf314598ab50a104946d97e60df0aa147ebf4 100644 (file)
--- 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
         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
         nodes = nodes + self.buckets[i].l
         if len(nodes) < K:
             # need more nodes