[WASM]Simplify code in RewriteReferenceEqualityOperations
@@ -41,25 +41,20 @@ public class RewriteReferenceEqualityOperations extends NormalizationPass {
new AbstractRewriter() {
@Override
public Node rewriteBinaryExpression(BinaryExpression expression) {
- if (expression.isReferenceComparison()
- && expression.getOperator() == BinaryOperator.NOT_EQUALS) {
- return rewriteNotEquals(expression);
+ if (!expression.isReferenceComparison()) {
+ return expression;
}
if (expression.getOperator() == BinaryOperator.EQUALS) {
return rewriteNullEquality(expression);
- }
-
- return expression;
- }
- });
- }
-
- private static Expression rewriteNotEquals(BinaryExpression expression) {
+ } else {
return rewriteNullEquality(
expression.getLeftOperand().infixEquals(expression.getRightOperand()))
.prefixNot();
}
+ }
+ });
+ }
private static Expression rewriteNullEquality(BinaryExpression expression) {
checkArgument(expression.getOperator() == BinaryOperator.EQUALS);
