Remove redundant and confusing else. #1555

Fixes `ConfusingElse` inspection violation.

Description:
>Reports confusing else branches. else branches are confusing when the if statement is followed by other statements and the if branch cannot complete normally, for example because it ends with a return statement. In these cases the statements in the else can be moved after the if statement and the else branch removed.
This commit is contained in:
Michal Kordas 2015-08-08 14:58:53 +02:00 committed by Roman Ivanov
parent 582751d04e
commit bf4e38c0c4
1 changed files with 1 additions and 6 deletions

View File

@ -579,12 +579,7 @@ public final class TreeWalker
if (ast1.getLineNo() < ast2.getLineNo()) {
return false;
}
else {
if (ast1.getColumnNo() > ast2.getColumnNo()) {
return true;
}
}
return false;
return ast1.getColumnNo() > ast2.getColumnNo();
}
/**