mirror of
https://github.com/alicebob/miniredis.git
synced 2024-07-21 14:03:53 +08:00
cleanup last commit
This commit is contained in:
parent
422ad09c16
commit
abc56151bb
@ -4,7 +4,6 @@ package miniredis
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
"math/rand"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@ -750,7 +749,7 @@ func (m *Miniredis) cmdHrandfield(c *server.Peer, cmd string, args []string) {
|
||||
// if count is negative there can be duplicates, but length will match
|
||||
if len(members) > 0 {
|
||||
for len(members) < -opts.count {
|
||||
members = append(members, members[rand.Intn(len(members))])
|
||||
members = append(members, members[m.randIntn(len(members))])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -634,13 +634,6 @@ func (m *Miniredis) randIntn(n int) int {
|
||||
return m.rand.Intn(n)
|
||||
}
|
||||
|
||||
func (m *Miniredis) randPerm(n int) []int {
|
||||
if m.rand == nil {
|
||||
return rand.Perm(n)
|
||||
}
|
||||
return m.rand.Perm(n)
|
||||
}
|
||||
|
||||
// shuffle shuffles a list of strings. Kinda.
|
||||
func (m *Miniredis) shuffle(l []string) {
|
||||
for range l {
|
||||
|
Loading…
Reference in New Issue
Block a user