summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-06-11 19:19:16 +0300
committerLars Wirzenius <liw@liw.fi>2017-06-11 19:19:16 +0300
commit754537b055681199865a77796c6c44d4077cf136 (patch)
tree1a9354b25fc898f9b38dca3a32eefa5fc901c9d1
parent98e73cdb0724c5382ed02a456346ccf6fbe7b73b (diff)
downloadobnam-754537b055681199865a77796c6c44d4077cf136.tar.gz
Refactor: extract new method is_chunk_used_by_anyone
-rw-r--r--obnamlib/fmt_ga/indexes.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/obnamlib/fmt_ga/indexes.py b/obnamlib/fmt_ga/indexes.py
index babc2e4b..ac22cb61 100644
--- a/obnamlib/fmt_ga/indexes.py
+++ b/obnamlib/fmt_ga/indexes.py
@@ -199,9 +199,12 @@ class GAChunkIndexes(object):
return [
chunk_id
for chunk_id in self._used_by_tree.keys()
- if self._used_by_tree.lookup(chunk_id) == []
+ if not self.is_chunk_used_by_anyone(chunk_id)
]
+ def is_chunk_used_by_anyone(self, chunk_id):
+ return self._used_by_tree(chunk_id) != []
+
def get_bags_contianing_chunks(self, chunk_store, chunk_ids):
return set(
chunk_id