From 0211948cacad12b3bdc8e6ab2f1ae2b093fc7e90 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Fri, 10 Jun 2022 20:58:33 +0200 Subject: [PATCH] remove csize from summarize return tuple --- src/borg/cache.py | 2 +- src/borg/hashindex.pyx | 4 ++-- src/borg/testsuite/hashindex.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/borg/cache.py b/src/borg/cache.py index 59b50837a..618a61925 100644 --- a/src/borg/cache.py +++ b/src/borg/cache.py @@ -423,7 +423,7 @@ def __str__(self): def stats(self): from .archive import Archive # XXX: this should really be moved down to `hashindex.pyx` - total_size, _, unique_size, _, total_unique_chunks, total_chunks = self.chunks.summarize() + total_size, unique_size, total_unique_chunks, total_chunks = self.chunks.summarize() # the above values have the problem that they do not consider part files, # thus the total_size might be too high (chunks referenced # by the part files AND by the complete file). diff --git a/src/borg/hashindex.pyx b/src/borg/hashindex.pyx index 6ef3a6d55..9720a0a49 100644 --- a/src/borg/hashindex.pyx +++ b/src/borg/hashindex.pyx @@ -358,7 +358,7 @@ cdef class ChunkIndex(IndexBase): return iter def summarize(self): - cdef uint64_t size = 0, csize = 0, unique_size = 0, unique_csize = 0, chunks = 0, unique_chunks = 0 + cdef uint64_t size = 0, unique_size = 0, chunks = 0, unique_chunks = 0 cdef uint32_t *values cdef uint32_t refcount cdef unsigned char *key = NULL @@ -375,7 +375,7 @@ cdef class ChunkIndex(IndexBase): unique_size += _le32toh(values[1]) size += _le32toh(values[1]) * _le32toh(values[0]) - return size, csize, unique_size, unique_csize, unique_chunks, chunks + return size, unique_size, unique_chunks, chunks def stats_against(self, ChunkIndex master_index): """ diff --git a/src/borg/testsuite/hashindex.py b/src/borg/testsuite/hashindex.py index f16706ca9..a96c76a6a 100644 --- a/src/borg/testsuite/hashindex.py +++ b/src/borg/testsuite/hashindex.py @@ -147,7 +147,7 @@ def test_chunkindex_summarize(self): idx[H(2)] = 2, 2000, 200 idx[H(3)] = 3, 3000, 300 - size, _, unique_size, _, unique_chunks, chunks = idx.summarize() + size, unique_size, unique_chunks, chunks = idx.summarize() assert size == 1000 + 2 * 2000 + 3 * 3000 assert unique_size == 1000 + 2000 + 3000 assert chunks == 1 + 2 + 3