nonbinaryprogrammer commented on a change in pull request #6783:
URL: https://github.com/apache/geode/pull/6783#discussion_r699652107



##########
File path: 
geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/data/RedisSortedSet.java
##########
@@ -265,30 +292,27 @@ long zcount(SortedSetScoreRangeOptions rangeOptions) {
     return maxIndex - minIndex;
   }
 
-  byte[] zincrby(Region<RedisKey, RedisData> region, RedisKey key, byte[] 
increment,
-      byte[] member) {
+  double zincrby(Region<RedisKey, RedisData> region, RedisKey key, double 
incr, byte[] member) {
+    double score;
     OrderedSetEntry orderedSetEntry = members.get(member);
-    double incr = processByteArrayAsDouble(increment);
 
     if (orderedSetEntry != null) {
-      double byteScore = orderedSetEntry.getScore();
-      incr += byteScore;
+      score = orderedSetEntry.getScore() + incr;
 
-      if (Double.isNaN(incr)) {
+      if (Double.isNaN(score)) {

Review comment:
       we can check in the executor if the increment is NaN and exit early, but 
that check in RedisSortedSet is still required. it handles the case where the 
score is -Infinity and the increment is +Infinity, which are both valid, but 
adding them produces NaN




-- 
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]


Reply via email to