mirror of
https://github.com/restic/restic.git
synced 2024-12-23 00:07:25 +00:00
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
1 changed files with 1 additions and 2 deletions
|
@ -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 a new issue