Skip to content

Commit 91a2988

Browse files
committed
Update Redis functions to use int for range parsing
1 parent 52337a3 commit 91a2988

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

adapter/redis.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ func parseRangeBounds(startRaw, endRaw []byte, total int) (int, int, error) {
634634
if err != nil {
635635
return 0, 0, err
636636
}
637-
s, e := clampRange(int(start), int(end), total)
637+
s, e := clampRange(start, end, total)
638638
return s, e, nil
639639
}
640640

@@ -991,7 +991,7 @@ func (r *RedisServer) proxyLRange(key []byte, startRaw, endRaw []byte) ([]string
991991
return nil, err
992992
}
993993

994-
res, err := cli.LRange(context.Background(), string(key), start, end).Result()
994+
res, err := cli.LRange(context.Background(), string(key), int64(start), int64(end)).Result()
995995
return res, errors.WithStack(err)
996996
}
997997

@@ -1017,8 +1017,8 @@ func (r *RedisServer) proxyRPush(key []byte, values [][]byte) (int64, error) {
10171017
return res, errors.WithStack(err)
10181018
}
10191019

1020-
func parseInt(b []byte) (int64, error) {
1021-
i, err := strconv.ParseInt(string(b), 10, 64)
1020+
func parseInt(b []byte) (int, error) {
1021+
i, err := strconv.Atoi(string(b))
10221022
return i, errors.WithStack(err)
10231023
}
10241024

0 commit comments

Comments
 (0)