Sho SHIMIZU

Return early when the value is null to reduce the depth of indents

Change-Id: I34b01d1888884ee752655d2b2bed1f6facb0b432
......@@ -51,6 +51,7 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.ArrayList;
......@@ -291,12 +292,15 @@ public class OFOpticalSwitchImplLINC13
}
private List<OFAction> buildActions(List<OFInstruction> iList, CircuitSignalID sigid) {
List<OFAction> actions = new ArrayList<>();
Map<OFInstructionType, OFInstruction> instructions = iList.stream()
.collect(Collectors.toMap(OFInstruction::getType, inst -> inst));
OFInstruction inst = instructions.get(OFInstructionType.APPLY_ACTIONS);
if (inst != null) {
if (inst == null) {
return Collections.emptyList();
}
List<OFAction> actions = new ArrayList<>();
OFInstructionApplyActions iaa = (OFInstructionApplyActions) inst;
if (iaa.getActions() == null) {
return actions;
......@@ -313,7 +317,6 @@ public class OFOpticalSwitchImplLINC13
actions.add(action);
}
});
}
return actions;
}
......