]> git.mxchange.org Git - quix0rs-apt-p2p.git/commitdiff
don't touch buckets when we are only reading from them
authorburris <burris>
Mon, 23 Sep 2002 22:08:40 +0000 (22:08 +0000)
committerburris <burris>
Mon, 23 Sep 2002 22:08:40 +0000 (22:08 +0000)
ktable.py

index f1c3b6ac50fa5856d2cdc96dd8ab725c0756df8d..711a537f4ad3eaa3b3b62f5f7a7d0e0757706e15 100644 (file)
--- a/ktable.py
+++ b/ktable.py
@@ -61,7 +61,6 @@ class KTable:
        except ValueError:
            pass
        else:
-           self.buckets[i].touch()
            return [self.buckets[i].l[index]]
            
        nodes = nodes + self.buckets[i].l
@@ -75,10 +74,8 @@ class KTable:
            while (len(nodes) < K and (min >= 0 or max < len(self.buckets))):
                if min >= 0:
                    nodes = nodes + self.buckets[min].l
-                   self.buckets[min].touch()
                if max < len(self.buckets):
                    nodes = nodes + self.buckets[max].l
-                   self.buckets[max].touch()
                min = min - 1
                max = max + 1
            nodes.sort(sort)
@@ -196,7 +193,6 @@ class KBucket:
     def getNodeWithInt(self, int):
        try:
            return self.l[self.l.index(int)]
-           self.touch()
        except IndexError:
            raise ValueError