Replace loop with Collection#removeIf where possible

This commit is contained in:
Basil Crow committed 2020-12-11 21:34:22 -08:00
1 parent 4284c3d2ab
commit 3764940c2d
2 files changed
+2 -8

No files matched your search

+1 -4
View File
@@ -1726,10 +1726,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
hudson.checkPermission(Jenkins.ADMINISTER);
UpdateCenter uc = hudson.getUpdateCenter();
PersistedList<UpdateSite> sites = uc.getSites();
for (UpdateSite s : sites) {
if (s.getId().equals(UpdateCenter.ID_DEFAULT))
sites.remove(s);
}
sites.removeIf(s -> s.getId().equals(UpdateCenter.ID_DEFAULT));
sites.add(new UpdateSite(UpdateCenter.ID_DEFAULT, site));
return new HttpRedirect("advanced");