From 2d7636521496d4e76b9d23ea635e9ec7faa37713 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Fri, 15 Jan 2021 21:10:07 +0100 Subject: [PATCH] cosmetic: directly set allocation instead going via is_zero --- src/borg/chunker.pyx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/borg/chunker.pyx b/src/borg/chunker.pyx index 210ea461c..3af84807b 100644 --- a/src/borg/chunker.pyx +++ b/src/borg/chunker.pyx @@ -207,19 +207,19 @@ class ChunkerFixed: got = len(data) if zeros.startswith(data): data = None - is_zero = True + allocation = CH_ALLOC else: - is_zero = False + allocation = CH_DATA else: # hole # seek over block from the range pos = dseek(wanted, os.SEEK_CUR, fd, fh) got = pos - offset data = None - is_zero = True + allocation = CH_HOLE if got > 0: offset += got range_size -= got - yield Chunk(data, size=got, allocation=(CH_ALLOC if is_zero else CH_DATA) if is_data else CH_HOLE) + yield Chunk(data, size=got, allocation=allocation) if got < wanted: # we did not get enough data, looks like EOF. return