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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to