projects
/
quix0rs-apt-p2p.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2a6434b
)
oops, another buglet
author
aaronsw
<aaronsw>
Thu, 28 Nov 2002 19:44:30 +0000
(19:44 +0000)
committer
aaronsw
<aaronsw>
Thu, 28 Nov 2002 19:44:30 +0000
(19:44 +0000)
ktable.py
patch
|
blob
|
history
diff --git
a/ktable.py
b/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
- 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