Kris-10-0 commented on a change in pull request #7228:
URL: https://github.com/apache/geode/pull/7228#discussion_r780556209



##########
File path: 
geode-for-redis/src/main/java/org/apache/geode/redis/internal/data/RedisSet.java
##########
@@ -161,49 +162,38 @@ public RedisSet() {}
     return popped;
   }
 
-  public Collection<byte[]> srandmember(int count) {
-    int membersSize = members.size();
+  public List<byte[]> srandmember(int count) {
     boolean duplicatesAllowed = count < 0;
-    if (duplicatesAllowed) {
-      count = -count;
-    }
-
-    if (!duplicatesAllowed && membersSize <= count && count != 1) {
-      return new ArrayList<>(members);
-    }
+    count = duplicatesAllowed ? -count : count;
+    int membersSize = members.size();
+    int memberMapSize = members.getMemberMapSize();
 
     Random rand = new Random();

Review comment:
       @DonalEvans Creating a final field for the class messes with the size of 
the bytes causing tests in RedisSet to fail.




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