mirror of https://github.com/ledisdb/ledisdb.git
bugfix scan count 0
This commit is contained in:
parent
9d00aa229d
commit
f22bbb97df
|
@ -295,10 +295,8 @@ func parseScanArgs(c *client) (key []byte, match string, count int, err error) {
|
||||||
switch strings.ToLower(ledis.String(args[1])) {
|
switch strings.ToLower(ledis.String(args[1])) {
|
||||||
case "match":
|
case "match":
|
||||||
match = ledis.String(args[2])
|
match = ledis.String(args[2])
|
||||||
return
|
|
||||||
case "count":
|
case "count":
|
||||||
count, err = strconv.Atoi(ledis.String(args[2]))
|
count, err = strconv.Atoi(ledis.String(args[2]))
|
||||||
return
|
|
||||||
default:
|
default:
|
||||||
err = ErrCmdParams
|
err = ErrCmdParams
|
||||||
return
|
return
|
||||||
|
@ -314,7 +312,10 @@ func parseScanArgs(c *client) (key []byte, match string, count int, err error) {
|
||||||
|
|
||||||
match = ledis.String(args[2])
|
match = ledis.String(args[2])
|
||||||
count, err = strconv.Atoi(ledis.String(args[4]))
|
count, err = strconv.Atoi(ledis.String(args[4]))
|
||||||
return
|
}
|
||||||
|
|
||||||
|
if count <= 0 {
|
||||||
|
err = ErrCmdParams
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue