aboutsummaryrefslogtreecommitdiff
path: root/weed/topology/topology_info.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/topology/topology_info.go')
-rw-r--r--weed/topology/topology_info.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/weed/topology/topology_info.go b/weed/topology/topology_info.go
index 680a0528c..afbeb4894 100644
--- a/weed/topology/topology_info.go
+++ b/weed/topology/topology_info.go
@@ -3,6 +3,7 @@ package topology
import (
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"golang.org/x/exp/slices"
+ "strings"
)
type TopologyInfo struct {
@@ -21,8 +22,8 @@ func (t *Topology) ToInfo() (info TopologyInfo) {
dcs = append(dcs, dc.ToInfo())
}
- slices.SortFunc(dcs, func(a, b DataCenterInfo) bool {
- return a.Id < b.Id
+ slices.SortFunc(dcs, func(a, b DataCenterInfo) int {
+ return strings.Compare(string(a.Id), string(b.Id))
})
info.DataCenters = dcs