Skip to content

Commit

Permalink
Cleanup - Use foreach loop instead of iterator
Browse files Browse the repository at this point in the history
This reduces boilerplate code.
  • Loading branch information
darxriggs committed Feb 14, 2019
1 parent 81ee0e9 commit 15abcbf
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/main/java/org/jvnet/hudson/test/MemoryAssert.java
Expand Up @@ -33,7 +33,6 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -256,9 +255,7 @@ private static Map<Object,Path> fromRoots(Collection<Object> objs, Set<Object> r
super.visitObject(map, object);
if (object instanceof ClassLoader) {
if (isKnown(object)) {
Iterator<Class> it = classes.iterator();
while (it.hasNext()) {
Class c = it.next();
for (Class c : classes) {
if (c.getClassLoader() == object) {
visitObjectReference(this, c, object, /* cannot get a Field for Class.classLoader, but unused here anyway */ null);
}
Expand Down

0 comments on commit 15abcbf

Please sign in to comment.