Use var in isIf/getIf

bzip2
Graham 5 years ago
parent 5fd2488988
commit a5e9a788e8
  1. 5
      deob-ast/src/main/java/dev/openrs2/deob/ast/transform/IfElseTransformer.java

@ -1,7 +1,6 @@
package dev.openrs2.deob.ast.transform;
import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.ast.NodeList;
import com.github.javaparser.ast.stmt.IfStmt;
import com.github.javaparser.ast.stmt.Statement;
import dev.openrs2.deob.ast.util.ExprUtils;
@ -11,7 +10,7 @@ public final class IfElseTransformer extends Transformer {
if (stmt.isIfStmt()) {
return true;
} else if (stmt.isBlockStmt()) {
NodeList<Statement> stmts = stmt.asBlockStmt().getStatements();
var stmts = stmt.asBlockStmt().getStatements();
return stmts.size() == 1 && stmts.get(0).isIfStmt();
} else {
return false;
@ -22,7 +21,7 @@ public final class IfElseTransformer extends Transformer {
if (stmt.isIfStmt()) {
return stmt.clone();
} else if (stmt.isBlockStmt()) {
NodeList<Statement> stmts = stmt.asBlockStmt().getStatements();
var stmts = stmt.asBlockStmt().getStatements();
if (stmts.size() == 1) {
Statement head = stmts.get(0);
if (head.isIfStmt()) {

Loading…
Cancel
Save