Use rand.Int*n()
where appropriate
This commit is contained in:
parent
e36686a17d
commit
66b4b2a99f
|
@ -348,7 +348,7 @@ func (b *EvalBroker) scanForSchedulers(schedulers []string) (*structs.Evaluation
|
|||
default:
|
||||
// Multiple tasks. We pick a random task so that we fairly
|
||||
// distribute work.
|
||||
offset := rand.Int63() % int64(n)
|
||||
offset := rand.Int63n(n)
|
||||
return b.dequeueForSched(eligibleSched[offset])
|
||||
}
|
||||
}
|
||||
|
|
|
@ -232,7 +232,7 @@ func (s *Server) forwardRegion(region, method string, args interface{}, reply in
|
|||
}
|
||||
|
||||
// Select a random addr
|
||||
offset := rand.Int31() % int32(len(servers))
|
||||
offset := rand.Int31n(len(servers))
|
||||
server := servers[offset]
|
||||
s.peerLock.RUnlock()
|
||||
|
||||
|
|
Loading…
Reference in a new issue