|
2 | 2 | //
|
3 | 3 | // This source file is part of the RediStack open source project
|
4 | 4 | //
|
5 |
| -// Copyright (c) 2019 RediStack project authors |
| 5 | +// Copyright (c) 2019-2022 RediStack project authors |
6 | 6 | // Licensed under Apache License v2.0
|
7 | 7 | //
|
8 | 8 | // See LICENSE.txt for license information
|
@@ -1121,7 +1121,7 @@ extension RedisClient {
|
1121 | 1121 | indices range: ClosedRange<Int>,
|
1122 | 1122 | includeScoresInResponse includeScores: Bool = false
|
1123 | 1123 | ) -> EventLoopFuture<[RESPValue]> {
|
1124 |
| - return self.zrange(from: key, firstIndex: range.lowerBound, lastIndex: range.upperBound, includeScoresInResponse: includeScores) |
| 1124 | + return self.zrevrange(from: key, firstIndex: range.lowerBound, lastIndex: range.upperBound, includeScoresInResponse: includeScores) |
1125 | 1125 | }
|
1126 | 1126 |
|
1127 | 1127 | /// Gets all the elements from a SortedSet starting with the first index bound up to, but not including, the element at the last index bound.
|
@@ -1163,7 +1163,7 @@ extension RedisClient {
|
1163 | 1163 | indices range: Range<Int>,
|
1164 | 1164 | includeScoresInResponse includeScores: Bool = false
|
1165 | 1165 | ) -> EventLoopFuture<[RESPValue]> {
|
1166 |
| - return self.zrange(from: key, firstIndex: range.lowerBound, lastIndex: range.upperBound - 1, includeScoresInResponse: includeScores) |
| 1166 | + return self.zrevrange(from: key, firstIndex: range.lowerBound, lastIndex: range.upperBound - 1, includeScoresInResponse: includeScores) |
1167 | 1167 | }
|
1168 | 1168 |
|
1169 | 1169 | /// Gets all elements from the index specified to the end of a SortedSet.
|
@@ -1191,7 +1191,7 @@ extension RedisClient {
|
1191 | 1191 | fromIndex index: Int,
|
1192 | 1192 | includeScoresInResponse includeScores: Bool = false
|
1193 | 1193 | ) -> EventLoopFuture<[RESPValue]> {
|
1194 |
| - return self.zrange(from: key, firstIndex: index, lastIndex: -1, includeScoresInResponse: includeScores) |
| 1194 | + return self.zrevrange(from: key, firstIndex: index, lastIndex: -1, includeScoresInResponse: includeScores) |
1195 | 1195 | }
|
1196 | 1196 |
|
1197 | 1197 | /// Gets all elements from the start of a SortedSet up to, and including, the element at the index specified.
|
@@ -1219,7 +1219,7 @@ extension RedisClient {
|
1219 | 1219 | throughIndex index: Int,
|
1220 | 1220 | includeScoresInResponse includeScores: Bool = false
|
1221 | 1221 | ) -> EventLoopFuture<[RESPValue]> {
|
1222 |
| - return self.zrange(from: key, firstIndex: 0, lastIndex: index, includeScoresInResponse: includeScores) |
| 1222 | + return self.zrevrange(from: key, firstIndex: 0, lastIndex: index, includeScoresInResponse: includeScores) |
1223 | 1223 | }
|
1224 | 1224 |
|
1225 | 1225 | /// Gets all elements from the start of a SortedSet up to, but not including, the element at the index specified.
|
@@ -1247,7 +1247,7 @@ extension RedisClient {
|
1247 | 1247 | upToIndex index: Int,
|
1248 | 1248 | includeScoresInResponse includeScores: Bool = false
|
1249 | 1249 | ) -> EventLoopFuture<[RESPValue]> {
|
1250 |
| - return self.zrange(from: key, firstIndex: 0, lastIndex: index - 1, includeScoresInResponse: includeScores) |
| 1250 | + return self.zrevrange(from: key, firstIndex: 0, lastIndex: index - 1, includeScoresInResponse: includeScores) |
1251 | 1251 | }
|
1252 | 1252 |
|
1253 | 1253 | func _zrange(
|
|
0 commit comments