We have a duplicate check of old state value, merge two 'if' statements
together.
Change-Id: I36611230ef27de80f91a61b604e7bd71646c4718
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
if (state == State.IDLE && newState == State.OPEN_WAIT) {
return true;
}
- if (state == State.OPEN_WAIT && newState == State.ESTABLISHED) {
- return true;
- }
- if (state == State.OPEN_WAIT && newState == State.FAILED) {
+ if (state == State.OPEN_WAIT && (newState == State.ESTABLISHED || newState == State.FAILED)) {
return true;
}
LOG.debug("Transition from {} to {} is not allowed", state, newState);