mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-22 14:11:27 +00:00
chunk_incref: compute "_size or size" only once
This commit is contained in:
parent
fc3498ac53
commit
2edbcd7703
1 changed files with 4 additions and 3 deletions
|
@ -1004,9 +1004,10 @@ def chunk_incref(self, id, stats, size=None):
|
||||||
count, _size, csize = self.chunks.incref(id)
|
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
|
# 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.
|
# 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
|
size = _size or size
|
||||||
stats.update(_size or size, csize, False)
|
assert size
|
||||||
return ChunkListEntry(id, _size or size, csize)
|
stats.update(size, csize, False)
|
||||||
|
return ChunkListEntry(id, size, csize)
|
||||||
|
|
||||||
def chunk_decref(self, id, stats, wait=True):
|
def chunk_decref(self, id, stats, wait=True):
|
||||||
if not self._txn_active:
|
if not self._txn_active:
|
||||||
|
|
Loading…
Reference in a new issue