Simplify iteration over maps

Closes gh-23053
This commit is contained in:
Сергей Цыпанов
2019-05-29 19:00:34 +03:00
committed by Sam Brannen
parent 5b04b04b69
commit aaeabc3c85
3 changed files with 8 additions and 8 deletions

View File

@@ -180,9 +180,9 @@ public class DefaultContextCache implements ContextCache {
}
// Remove empty entries from the hierarchy map.
for (MergedContextConfiguration currentKey : this.hierarchyMap.keySet()) {
if (this.hierarchyMap.get(currentKey).isEmpty()) {
this.hierarchyMap.remove(currentKey);
for (Map.Entry<MergedContextConfiguration, Set<MergedContextConfiguration>> entry : this.hierarchyMap.entrySet()) {
if (entry.getValue().isEmpty()) {
this.hierarchyMap.remove(entry.getKey());
}
}
}