Skip to content

Commit

Permalink
rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
blight19 committed Jan 10, 2024
1 parent 90619a3 commit 0747769
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/selector.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,13 @@ func (s geoSelector) Select(ctx context.Context, servicePath, serviceMethod stri
}

var server []string
min := math.MaxFloat64
minNum := math.MaxFloat64
for _, gs := range s.servers {
d := getDistanceFrom(s.Latitude, s.Longitude, gs.Latitude, gs.Longitude)
if d < min {
if d < minNum {
server = []string{gs.Server}
min = d
} else if d == min {
minNum = d
} else if d == minNum {
server = append(server, gs.Server)
}
}
Expand Down

0 comments on commit 0747769

Please sign in to comment.