Use Java 5 foreach for arrays for brevity at no cost

This commit is contained in:
Trustin Lee 2014-06-02 18:25:25 +09:00
parent 642f4bb3b1
commit ddb6441212

View File

@ -207,8 +207,8 @@ final class PoolThreadCache {
} }
int numFreed = 0; int numFreed = 0;
for (int i = 0; i < caches.length; i++) { for (MemoryRegionCache<?> c: caches) {
numFreed += free(caches[i]); numFreed += free(c);
} }
return numFreed; return numFreed;
} }
@ -233,8 +233,8 @@ final class PoolThreadCache {
if (caches == null) { if (caches == null) {
return; return;
} }
for (int i = 0; i < caches.length; i++) { for (MemoryRegionCache<?> c: caches) {
trim(caches[i]); trim(c);
} }
} }