Sho SHIMIZU
Committed by Gerrit Code Review

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
......@@ -455,12 +455,10 @@ class ConfigProvider implements DeviceProvider, LinkProvider, HostProvider {
.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.
......