dschneider-pivotal commented on a change in pull request #6735:
URL: https://github.com/apache/geode/pull/6735#discussion_r686195561
##########
File path:
geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/data/RedisSortedSet.java
##########
@@ -357,6 +357,27 @@ long zcount(SortedSetScoreRangeOptions rangeOptions) {
return addLimitToRange(rangeOptions, withScores, minIndex, maxIndex);
}
+ long zlexcount(SortedSetLexRangeOptions lexOptions) {
+ // Assume that all members have the same score. Behaviour is unspecified
otherwise.
+ double score = scoreSet.get(0).score;
+
+ AbstractOrderedSetEntry minEntry = new
MemberDummyOrderedSetEntry(lexOptions.getMinimum(),
Review comment:
consider extracting these two blocks into getMinIndex(lexOptions, score)
and getMaxIndex(lexOptions, score). These new methods could also be used by
zrangebylex
##########
File path:
geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/data/RedisSortedSet.java
##########
@@ -357,6 +357,27 @@ long zcount(SortedSetScoreRangeOptions rangeOptions) {
return addLimitToRange(rangeOptions, withScores, minIndex, maxIndex);
}
+ long zlexcount(SortedSetLexRangeOptions lexOptions) {
+ // Assume that all members have the same score. Behaviour is unspecified
otherwise.
+ double score = scoreSet.get(0).score;
Review comment:
Before you call get(0) do you need to do a check on scoreSet to see if
it is empty?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]