archiver/archiver: Use Index.Has() instead of Index.Lookup() in isKnownBlob

Index.Has() is a faster then Index.Lookup() for checking if a blob exists
in the index.  As the returned data is never used, this avoids a ton
of allocations.
This commit is contained in:
Matthew Dawson 2018-01-12 01:21:39 -05:00
parent df2c03a6a4
commit 3a16148447
No known key found for this signature in database
GPG Key ID: 404D7F645F682028
1 changed files with 1 additions and 2 deletions

View File

@ -86,8 +86,7 @@ func (arch *Archiver) isKnownBlob(id restic.ID, t restic.BlobType) bool {
arch.knownBlobs.Insert(id)
_, found := arch.repo.Index().Lookup(id, t)
if found {
if arch.repo.Index().Has(id, t) {
return true
}