repository: MasterIndex.Packs: reduce allocations

This commit is contained in:
Michael Eischer 2022-08-19 21:10:43 +02:00
parent 6ff9517e45
commit 77b1980d8e
1 changed files with 1 additions and 1 deletions

View File

@ -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)