You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2022/01/21 18:11:51 UTC

[GitHub] [geode] dschneider-pivotal commented on a change in pull request #7295: GEODE-9922: Move Redis cross-slot checking to RegionProvider

dschneider-pivotal commented on a change in pull request #7295:
URL: https://github.com/apache/geode/pull/7295#discussion_r789890912



##########
File path: geode-for-redis/src/main/java/org/apache/geode/redis/internal/services/RegionProvider.java
##########
@@ -155,6 +160,18 @@ public String getRedisRegionName() {
     }
   }
 
+  @VisibleForTesting
+  static boolean areKeysCrossSlots(List<RedisKey> keysToLock) {
+    int slot = keysToLock.get(0).getSlot();
+    for (int i = 1, keysToLockSize = keysToLock.size(); i < keysToLockSize; i++) {

Review comment:
       I think this just iterates over all the elements in keysToLock with the exception of element 0. If this is correct, I think the code would be cleaner if you got a sublist from keysToLock and iterated over it. Declaring "keysToLockSize" in the "for" expression makes it look like something that might change in the loop but I think it never does.




-- 
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: notifications-unsubscribe@geode.apache.org

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