From 055668758459d73e390ea5d23f2f21d8b7a550a0 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 12 Jan 2017 22:14:31 +0100 Subject: [PATCH] Reduce memory usage for prune --- src/restic/repository/master_index.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/restic/repository/master_index.go b/src/restic/repository/master_index.go index 165bf6024..8019d8781 100644 --- a/src/restic/repository/master_index.go +++ b/src/restic/repository/master_index.go @@ -46,9 +46,8 @@ func (mi *MasterIndex) LookupSize(id restic.ID, tpe restic.BlobType) (uint, erro defer mi.idxMutex.RUnlock() for _, idx := range mi.idx { - length, err := idx.LookupSize(id, tpe) - if err == nil { - return length, nil + if idx.Has(id, tpe) { + return idx.LookupSize(id, tpe) } }