Skip to content

Commit 7dff890

Browse files
committed
use for-each loop
1 parent 7c347d0 commit 7dff890

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

visualvm/libs.profiler/profiler/src/org/graalvm/visualvm/lib/profiler/ResultsManager.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,17 +1318,14 @@ private void exportSnapshot(FileObject selectedSnapshot, FileObject targetFolder
13181318
}
13191319

13201320
private LoadedSnapshot findAlreadyLoadedSnapshot(FileObject selectedFile) {
1321-
Iterator it = loadedSnapshots.iterator();
13221321
File f = FileUtil.toFile(selectedFile);
13231322

13241323
if (f == null) {
13251324
return null;
13261325
}
13271326

1328-
while (it.hasNext()) {
1329-
LoadedSnapshot ls = (LoadedSnapshot) it.next();
1330-
1331-
if ((ls.getFile() != null) && (ls.getFile().equals(f))) {
1327+
for (LoadedSnapshot ls : loadedSnapshots) {
1328+
if (Objects.equals(ls.getFile(), f)) {
13321329
return ls;
13331330
}
13341331
}

0 commit comments

Comments
 (0)