Skip to content

Commit

Permalink
fix boolean logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bastiandoetsch committed Sep 19, 2023
1 parent 1eba0ae commit e16b542
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func selectBestServerIndex(servers []server, country string, provider string) in
bestIndex := -1
var bestPing time.Duration
for i, server := range servers {
if server.Active && server.CountryCode == country && provider == "" || server.Provider == provider {
if server.Active && server.CountryCode == country && (provider == "" || server.Provider == provider) {
duration, err := serverLatency(server)
if err == nil {
if bestIndex == -1 || bestPing > duration {
Expand Down

0 comments on commit e16b542

Please sign in to comment.