Skip to content

Commit 031bbe9

Browse files
author
mafagafogigante
committed
Simplifies an if statement
1 parent b563de0 commit 031bbe9

File tree

1 file changed

+1
-5
lines changed
  • interpreter/src/main/java/com/iluwatar

1 file changed

+1
-5
lines changed

interpreter/src/main/java/com/iluwatar/App.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,7 @@ public static void main(String[] args) {
5050
}
5151

5252
public static boolean isOperator(String s) {
53-
if (s.equals("+") || s.equals("-") || s.equals("*")) {
54-
return true;
55-
} else {
56-
return false;
57-
}
53+
return s.equals("+") || s.equals("-") || s.equals("*");
5854
}
5955

6056
public static Expression getOperatorInstance(String s, Expression left,

0 commit comments

Comments
 (0)