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



##########
File path: 
geode-for-redis/src/main/java/org/apache/geode/redis/internal/data/RedisSet.java
##########
@@ -110,6 +111,47 @@ private static MemberSet calculateDiff(RegionProvider 
regionProvider, List<Redis
     return diff;
   }
 
+  public static Set<byte[]> sinter(RegionProvider regionProvider, 
List<RedisKey> keys) {
+    MemberSet result = calculateInter(regionProvider, keys);
+    if (result == null) {
+      return Collections.emptySet();
+    }
+    return result;
+  }
+
+  private static MemberSet calculateInter(RegionProvider regionProvider, 
List<RedisKey> keys) {
+    List<RedisSet> sets = new ArrayList<>(keys.size());
+    RedisSet smallestSet = null;
+
+    for (RedisKey key : keys) {
+      RedisSet redisSet = regionProvider.getTypedRedisData(REDIS_SET, key, 
true);
+      if (redisSet == NULL_REDIS_SET || redisSet.scard() == 0) {
+        return null;

Review comment:
       If you inline the `calculateInter()` method, then returning 
`Collections.emptySet()` here is fine, since `sinter()` returns a `Set<byte[]>`




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