Replaced redundant 'negate' operator with *= -1

This commit is contained in:
Anuken
2020-08-23 10:20:34 -04:00
parent 90b8910935
commit dac24e8bf1
2 changed files with 10 additions and 5 deletions

View File

@@ -120,10 +120,16 @@ public class LAssembler{
}else if(type.equals("uop")){
arr[0] = "op";
//field order for uop used to be op a, result, but now it's op result a
String res = arr[3];
arr[3] = arr[2];
arr[2] = res;
if(arr[1].equals("negate")){
arr = new String[]{
"op", "mul", arr[3], arr[2], "-1"
};
}else{
//field order for uop used to be op a, result, but now it's op result a
String res = arr[3];
arr[3] = arr[2];
arr[2] = res;
}
}
LStatement st = LogicIO.read(arr);