|
|
@@ -1129,9 +1129,10 @@ PyVar pkpy::NativeFunc::operator()(VM* vm, const pkpy::Args& args) const{
|
|
|
|
|
|
void CodeObject::optimize(VM* vm){
|
|
|
for(int i=1; i<codes.size(); i++){
|
|
|
- if(codes[i].op == OP_UNARY_NEGATIVE && codes[i-1].op == OP_LOAD_CONST){
|
|
|
- codes[i].op = OP_NO_OP;
|
|
|
- int pos = codes[i-1].arg;
|
|
|
- consts[pos] = vm->num_negated(consts[pos]);
|
|
|
+ if(codes[i].op == OP_UNARY_NEGATIVE && codes[i-1].op == OP_LOAD_CONST){
|
|
|
+ codes[i].op = OP_NO_OP;
|
|
|
+ int pos = codes[i-1].arg;
|
|
|
+ consts[pos] = vm->num_negated(consts[pos]);
|
|
|
+ }
|
|
|
}
|
|
|
}
|