mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Simplify DefaultContextCache implementation by using entrySet().removeIf()
This commit is contained in:
+1
-5
@@ -341,11 +341,7 @@ public class DefaultContextCache implements ContextCache {
|
||||
}
|
||||
|
||||
// Remove empty entries from the hierarchy map.
|
||||
for (Map.Entry<MergedContextConfiguration, Set<MergedContextConfiguration>> entry : this.hierarchyMap.entrySet()) {
|
||||
if (entry.getValue().isEmpty()) {
|
||||
this.hierarchyMap.remove(entry.getKey());
|
||||
}
|
||||
}
|
||||
this.hierarchyMap.entrySet().removeIf(entry -> entry.getValue().isEmpty());
|
||||
}
|
||||
|
||||
private void remove(List<MergedContextConfiguration> removedContexts, MergedContextConfiguration key) {
|
||||
|
||||
Reference in New Issue
Block a user