mirror of https://github.com/restic/restic.git
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:
parent
df2c03a6a4
commit
3a16148447
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue