refactor: use slices package for sort (#10132)

The sort package is still used in places that were not trivial to
change. Since Go 1.21 slices package can be uswed for sort. See
https://go.dev/doc/go1.21#slices

### Purpose

Make some progress with the migration to a more up-to-date syntax.
This commit is contained in:
Marcel Meyer
2025-05-26 13:37:26 +02:00
committed by GitHub
parent 58c85fc9db
commit 48b757cac1
29 changed files with 85 additions and 80 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ package db
import (
"encoding/binary"
"sort"
"slices"
"github.com/syncthing/syncthing/lib/db/backend"
"github.com/syncthing/syncthing/lib/sync"
@@ -147,6 +147,6 @@ func (i *smallIndex) Values() []string {
}
i.mut.Unlock()
sort.Strings(vals)
slices.Sort(vals)
return vals
}