summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2010-12-27 21:32:05 +0000
committerLars Wirzenius <liw@liw.fi>2010-12-27 21:32:05 +0000
commit9c23fcbf7b030d0d5ef9752320b3a9baaca22bbc (patch)
tree1a47e04f63280147f0839516bfc7113f6ecfe907
parentea3bd67c13c867a590523ef540af1c5de603f85e (diff)
downloadobnam-9c23fcbf7b030d0d5ef9752320b3a9baaca22bbc.tar.gz
Use new range_is_empty method for btrees.
-rw-r--r--obnamlib/checksumtree.py2
-rw-r--r--obnamlib/clientmetadatatree.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/obnamlib/checksumtree.py b/obnamlib/checksumtree.py
index 061ca255..6d5b458a 100644
--- a/obnamlib/checksumtree.py
+++ b/obnamlib/checksumtree.py
@@ -68,7 +68,7 @@ class ChecksumTree(obnamlib.StoreTree):
minkey = self.key(checksum, chunk_id, 0)
maxkey = self.key(checksum, chunk_id, obnamlib.MAX_ID)
t = self.forest.trees[-1]
- return len(t.lookup_range(minkey, maxkey)) > 0
+ return not t.range_is_empty(minkey, maxkey)
else:
return False
diff --git a/obnamlib/clientmetadatatree.py b/obnamlib/clientmetadatatree.py
index 8fc01782..2f540849 100644
--- a/obnamlib/clientmetadatatree.py
+++ b/obnamlib/clientmetadatatree.py
@@ -353,7 +353,7 @@ class ClientMetadataTree(obnamlib.StoreTree):
minkey = self.chunk_key(chunk_id, 0)
maxkey = self.chunk_key(chunk_id, obnamlib.MAX_ID)
t = self.find_generation(gen_id)
- return len(t.lookup_range(minkey, maxkey)) > 0
+ return not t.range_is_empty(minkey, maxkey)
def list_chunks_in_generation(self, gen_id):
'''Return list of chunk ids used in a given generation.'''