Remove unnecessary empty set check
It isn't harmful to remove the if statement because missing.forEach()
doesn't call the specified lambda when it is empty.
Change-Id: I3f43f5fd4a4422899c621f2a63c0259f1bae838a
diff --git a/web/api/src/main/java/org/onosproject/rest/resources/ConfigProvider.java b/web/api/src/main/java/org/onosproject/rest/resources/ConfigProvider.java
index 57eefa4..44772bf 100644
--- a/web/api/src/main/java/org/onosproject/rest/resources/ConfigProvider.java
+++ b/web/api/src/main/java/org/onosproject/rest/resources/ConfigProvider.java
@@ -455,12 +455,10 @@
.filter(cp -> !existing.contains(cp))
.collect(Collectors.toSet());
- if (!missing.isEmpty()) {
- List<PortDescription> newPorts = Lists.newArrayList();
- ports.forEach(p -> newPorts.add(description(p)));
- missing.forEach(cp -> newPorts.add(description(cp)));
- deviceProviderService.updatePorts(device.id(), newPorts);
- }
+ List<PortDescription> newPorts = Lists.newArrayList();
+ ports.forEach(p -> newPorts.add(description(p)));
+ missing.forEach(cp -> newPorts.add(description(cp)));
+ deviceProviderService.updatePorts(device.id(), newPorts);
}
// Creates a port description from the specified port.