From 77b1980d8e77889d4b49a2912b9397bcd29588cc Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Fri, 19 Aug 2022 21:10:43 +0200 Subject: [PATCH] repository: MasterIndex.Packs: reduce allocations --- internal/repository/master_index.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/repository/master_index.go b/internal/repository/master_index.go index 058a3a662..05d0fdce2 100644 --- a/internal/repository/master_index.go +++ b/internal/repository/master_index.go @@ -150,7 +150,7 @@ func (mi *MasterIndex) Packs(packBlacklist restic.IDSet) restic.IDSet { packs := restic.NewIDSet() for _, idx := range mi.idx { idxPacks := idx.Packs() - if idx.final { + if idx.final && len(packBlacklist) > 0 { idxPacks = idxPacks.Sub(packBlacklist) } packs.Merge(idxPacks)