committed by
Jakob Borg
parent
d8fa61e27c
commit
e714df013f
@@ -6,13 +6,13 @@ import (
|
||||
"crypto/tls"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"github.com/syncthing/syncthing/lib/osutil"
|
||||
"github.com/syncthing/syncthing/lib/rand"
|
||||
"github.com/syncthing/syncthing/lib/relay/protocol"
|
||||
"github.com/syncthing/syncthing/lib/sync"
|
||||
)
|
||||
@@ -209,7 +209,7 @@ func relayAddressesOrder(input []string) []string {
|
||||
|
||||
var ids []int
|
||||
for id, bucket := range buckets {
|
||||
shuffle(bucket)
|
||||
rand.Shuffle(bucket)
|
||||
ids = append(ids, id)
|
||||
}
|
||||
|
||||
@@ -223,10 +223,3 @@ func relayAddressesOrder(input []string) []string {
|
||||
|
||||
return addresses
|
||||
}
|
||||
|
||||
func shuffle(slice []string) {
|
||||
for i := len(slice) - 1; i > 0; i-- {
|
||||
j := rand.Intn(i + 1)
|
||||
slice[i], slice[j] = slice[j], slice[i]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user