diff --git a/server/cmd_zset.go b/server/cmd_zset.go index eb25073..e8e8014 100644 --- a/server/cmd_zset.go +++ b/server/cmd_zset.go @@ -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