Replace sort.Stable by sort.Strings

Calling the slow, O(n lg² n) sort.Stable is equivalent to sort.Strings
for a slice of unique strings.
This commit is contained in:
greatroar 2020-02-17 09:30:00 +01:00
parent f2bf06a419
commit 3a6feb0596

View file

@ -515,7 +515,7 @@ func (arch *Archiver) SaveTree(ctx context.Context, snPath string, atree *Tree,
for name := range atree.Nodes {
names = append(names, name)
}
sort.Stable(sort.StringSlice(names))
sort.Strings(names)
for _, name := range names {
subatree := atree.Nodes[name]