DonalEvans commented on a change in pull request #6768:
URL: https://github.com/apache/geode/pull/6768#discussion_r697731061



##########
File path: 
geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/data/RedisSortedSet.java
##########
@@ -145,16 +153,16 @@ public boolean equals(Object o) {
       return false;
     }
 
-    for (Map.Entry<byte[], OrderedSetEntry> entry : members.entrySet()) {
+    return members.fastWhileEach(entry -> {
       OrderedSetEntry otherEntry = other.members.get(entry.getKey());
       if (otherEntry == null) {
         return false;
       }
       if (Double.compare(otherEntry.getScore(), entry.getValue().getScore()) 
!= 0) {
         return false;
       }
-    }
-    return true;
+      return true;
+    });

Review comment:
       Ah, that's right. This can still be simplified though:
   ```
   return Double.compare(otherEntry.getScore(), entry.getValue().getScore()) == 
0;
   ```




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