forked from TrueCloudLab/restic
Merge pull request #2628 from MichaelEischer/one-element-pack-lists
cache: Don't sort one element pack lists
This commit is contained in:
commit
16710454f4
1 changed files with 5 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue