I have a question.
In my bytecode i calculate statements like if((1==1) && (2==2)){} with this code
if (node.getOperator().equals(Operator.LOGICAL_AND)) {
mn.instructions.add(new InsnNode(Opcodes.IAND));
jmp = new JumpInsnNode(Opcodes.IFNE, null);
mn.instructions.add(jmp);
}
What happens is that i need to calculate both operator's expressions right and left in order to have a result.The second way is obvious: if the left expression is zero then leave.With this way you don't have to calculate both sides.
My question is:Is it wrong to do it with the first way?
Thanks in advanced.