From 2edbcd770393e85eff70d57548763f8204874ed0 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 23 Jul 2017 13:51:35 +0200 Subject: [PATCH] chunk_incref: compute "_size or size" only once --- src/borg/cache.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/borg/cache.py b/src/borg/cache.py index c07135254..cd381cd91 100644 --- a/src/borg/cache.py +++ b/src/borg/cache.py @@ -1004,9 +1004,10 @@ Chunk index: {0.total_unique_chunks:20d} unknown""" count, _size, csize = self.chunks.incref(id) # When _size is 0 and size is not given, then this chunk has not been locally visited yet (seen_chunk with # size or add_chunk); we can't add references to those (size=0 is invalid) and generally don't try to. - assert _size or size - stats.update(_size or size, csize, False) - return ChunkListEntry(id, _size or size, csize) + size = _size or size + assert size + stats.update(size, csize, False) + return ChunkListEntry(id, size, csize) def chunk_decref(self, id, stats, wait=True): if not self._txn_active: