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;
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);
}
}