mirror of https://github.com/ledisdb/ledisdb.git
bug fix: argument checking of funtion
This commit is contained in:
parent
f95494386a
commit
0d01d7e7ed
|
@ -120,17 +120,18 @@ func zparseScoreRange(minBuf []byte, maxBuf []byte) (min int64, max int64, err e
|
|||
if strings.ToLower(ledis.String(minBuf)) == "-inf" {
|
||||
min = math.MinInt64
|
||||
} else {
|
||||
var lopen bool = false
|
||||
if minBuf[0] == '(' {
|
||||
lopen = true
|
||||
minBuf = minBuf[1:]
|
||||
}
|
||||
|
||||
if len(minBuf) == 0 {
|
||||
err = ErrCmdParams
|
||||
return
|
||||
}
|
||||
|
||||
var lopen bool = false
|
||||
if minBuf[0] == '(' {
|
||||
lopen = true
|
||||
minBuf = minBuf[1:]
|
||||
}
|
||||
|
||||
min, err = ledis.StrInt64(minBuf, nil)
|
||||
if err != nil {
|
||||
return
|
||||
|
@ -150,16 +151,17 @@ func zparseScoreRange(minBuf []byte, maxBuf []byte) (min int64, max int64, err e
|
|||
max = math.MaxInt64
|
||||
} else {
|
||||
var ropen = false
|
||||
if maxBuf[0] == '(' {
|
||||
ropen = true
|
||||
maxBuf = maxBuf[1:]
|
||||
}
|
||||
|
||||
if len(maxBuf) == 0 {
|
||||
err = ErrCmdParams
|
||||
return
|
||||
}
|
||||
|
||||
if maxBuf[0] == '(' {
|
||||
ropen = true
|
||||
maxBuf = maxBuf[1:]
|
||||
}
|
||||
|
||||
max, err = ledis.StrInt64(maxBuf, nil)
|
||||
if err != nil {
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue