Skip to content

Commit

Permalink
sort result
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
  • Loading branch information
timvaillancourt committed Jan 15, 2025
1 parent c7950a2 commit 14ce279
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions go/vt/vtorc/logic/tablet_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ func getKeyspaceShardsToWatch() ([]*topo.KeyspaceShard, error) {
return nil, err
}

slices.SortStableFunc(keyspaceShards, func(a, b *topo.KeyspaceShard) int {
ksStrA := topoproto.KeyspaceShardString(a.Keyspace, a.Shard)
ksStrB := topoproto.KeyspaceShardString(b.Keyspace, b.Shard)
return strings.Compare(ksStrA, ksStrB)
})

return keyspaceShards, nil
}

Expand Down

0 comments on commit 14ce279

Please sign in to comment.