repository: MasterIndex.Packs: reduce allocations

This commit is contained in:
Michael Eischer 2022-08-19 21:10:43 +02:00
parent 6ff9517e45
commit 77b1980d8e

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)