Replaced redundant 'negate' operator with *= -1
This commit is contained in:
@@ -120,10 +120,16 @@ public class LAssembler{
|
|||||||
}else if(type.equals("uop")){
|
}else if(type.equals("uop")){
|
||||||
arr[0] = "op";
|
arr[0] = "op";
|
||||||
|
|
||||||
//field order for uop used to be op a, result, but now it's op result a
|
if(arr[1].equals("negate")){
|
||||||
String res = arr[3];
|
arr = new String[]{
|
||||||
arr[3] = arr[2];
|
"op", "mul", arr[3], arr[2], "-1"
|
||||||
arr[2] = res;
|
};
|
||||||
|
}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);
|
LStatement st = LogicIO.read(arr);
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ public enum LogicOp{
|
|||||||
atan2("atan2", (x, y) -> Mathf.atan2((float)x, (float)y) * Mathf.radDeg),
|
atan2("atan2", (x, y) -> Mathf.atan2((float)x, (float)y) * Mathf.radDeg),
|
||||||
dst("dst", (x, y) -> Mathf.dst((float)x, (float)y)),
|
dst("dst", (x, y) -> Mathf.dst((float)x, (float)y)),
|
||||||
|
|
||||||
negate("-", a -> -a),
|
|
||||||
not("not", a -> ~(int)(a)),
|
not("not", a -> ~(int)(a)),
|
||||||
abs("abs", Math::abs),
|
abs("abs", Math::abs),
|
||||||
log("log", Math::log),
|
log("log", Math::log),
|
||||||
|
|||||||
Reference in New Issue
Block a user