diff --git a/buffer/src/main/java/io/netty/buffer/PoolThreadCache.java b/buffer/src/main/java/io/netty/buffer/PoolThreadCache.java index 167072b4b7..497f12b0ef 100644 --- a/buffer/src/main/java/io/netty/buffer/PoolThreadCache.java +++ b/buffer/src/main/java/io/netty/buffer/PoolThreadCache.java @@ -207,8 +207,8 @@ final class PoolThreadCache { } int numFreed = 0; - for (int i = 0; i < caches.length; i++) { - numFreed += free(caches[i]); + for (MemoryRegionCache c: caches) { + numFreed += free(c); } return numFreed; } @@ -233,8 +233,8 @@ final class PoolThreadCache { if (caches == null) { return; } - for (int i = 0; i < caches.length; i++) { - trim(caches[i]); + for (MemoryRegionCache c: caches) { + trim(c); } }