ringles commented on a change in pull request #6487:
URL: https://github.com/apache/geode/pull/6487#discussion_r634520633



##########
File path: 
geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/data/NullRedisSet.java
##########
@@ -122,30 +118,38 @@ private int doSetOpWhileLocked(SetOp setOp, CommandHelper 
helper,
     }
   }
 
-  private Set<ByteArrayWrapper> computeSetOp(SetOp setOp,
-      ArrayList<Set<ByteArrayWrapper>> nonDestinationSets,
-      CommandHelper helper,
-      RedisKey destination) {
-    Set<ByteArrayWrapper> result = null;
+  private Set<byte[]> computeSetOp(SetOp setOp, List<Set<byte[]>> 
nonDestinationSets,
+      CommandHelper helper, RedisKey destination) {
+    ObjectOpenCustomHashSet<byte[]> result = null;
     if (nonDestinationSets.isEmpty()) {
       return emptySet();
     }
-    for (Set<ByteArrayWrapper> set : nonDestinationSets) {
+    for (Set<byte[]> set : nonDestinationSets) {
       if (set == null) {
         set = helper.getRedisSet(destination, false).smembers();
       }
       if (result == null) {
-        result = set;
+        result = new ObjectOpenCustomHashSet<>(set, ByteArrays.HASH_STRATEGY);
       } else {
         switch (setOp) {
           case UNION:
             result.addAll(set);
             break;
           case INTERSECTION:
-            result.retainAll(set);
+            List<byte[]> membersToRemove = new ArrayList<>();

Review comment:
       You might pull this and DIFF into sub-methods, just to make it a little 
easier to read. Not critical, but nice-to-have.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to