Skip to content

Commit 7a6b3eb

Browse files
authored
Reduce overhead of RedisClusterNode.forEachSlot #2058
1 parent 21ced53 commit 7a6b3eb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/io/lettuce/core/cluster/models/partitions/RedisClusterNode.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ public void forEachSlot(IntConsumer consumer) {
300300
return;
301301
}
302302

303-
for (int i = 0; i < this.slots.length(); i++) {
303+
int length = this.slots.length();
304+
for (int i = 0; i < length; i++) {
304305

305306
if (this.slots.get(i)) {
306307
consumer.accept(i);

0 commit comments

Comments
 (0)