From: burris Date: Mon, 23 Sep 2002 22:08:40 +0000 (+0000) Subject: don't touch buckets when we are only reading from them X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=19713b7fc0fa3becd2d3f56493a4582b16b68dc7;p=quix0rs-apt-p2p.git don't touch buckets when we are only reading from them --- diff --git a/ktable.py b/ktable.py index f1c3b6a..711a537 100644 --- 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