1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-21 21:57:36 +00:00

chunk_incref: compute "_size or size" only once

This commit is contained in:
Thomas Waldmann 2017-07-23 13:51:35 +02:00
parent fc3498ac53
commit 2edbcd7703

View file

@ -1004,9 +1004,10 @@ def chunk_incref(self, id, stats, size=None):
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: