mirror of
https://github.com/restic/restic.git
synced 2025-08-12 17:18:05 +00:00
Merge pull request #2628 from MichaelEischer/one-element-pack-lists
cache: Don't sort one element pack lists
This commit is contained in:
@@ -111,6 +111,11 @@ func (r *Repository) sortCachedPacks(blobs []restic.PackedBlob) []restic.PackedB
|
||||
return blobs
|
||||
}
|
||||
|
||||
// no need to sort a list with one element
|
||||
if len(blobs) == 1 {
|
||||
return blobs
|
||||
}
|
||||
|
||||
cached := make([]restic.PackedBlob, 0, len(blobs)/2)
|
||||
noncached := make([]restic.PackedBlob, 0, len(blobs)/2)
|
||||
|
||||
|
Reference in New Issue
Block a user