Use enhanced for loop where feasible

See gh-31916
This commit is contained in:
Yanming Zhou
2023-12-28 15:15:07 +08:00
committed by Stéphane Nicoll
parent ed1bfb8177
commit 4a450c6fab
6 changed files with 10 additions and 17 deletions

View File

@@ -607,8 +607,8 @@ public class ConcurrentReferenceHashMap<K, V> extends AbstractMap<K, V> implemen
// Restructure the resized reference array
if (resizing) {
Reference<K, V>[] restructured = createReferenceArray(restructureSize);
for (int i = 0; i < this.references.length; i++) {
ref = this.references[i];
for (Reference<K, V> reference : this.references) {
ref = reference;
while (ref != null) {
if (!toPurge.contains(ref)) {
Entry<K, V> entry = ref.get();