chore(stdiscosrv): simplify sorting

This commit is contained in:
Jakob Borg
2024-09-13 08:48:03 +02:00
parent f9b72330a8
commit 5c2fcbfd19
2 changed files with 12 additions and 33 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ import (
"net"
"net/http"
"net/url"
"sort"
"slices"
"strconv"
"strings"
"sync"
@@ -311,7 +311,7 @@ func (s *apiSrv) handleAnnounce(deviceID protocol.DeviceID, addresses []string)
// The address slice must always be sorted for database merges to work
// properly.
sort.Sort(databaseAddressOrder(dbAddrs))
slices.SortFunc(dbAddrs, DatabaseAddress.Cmp)
seen := now.UnixNano()
if s.repl != nil {