8000 simplify optimize_if_const_unaryop · python/cpython@2c5ee86 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2c5ee86

Browse files
committed
simplify optimize_if_const_unaryop
1 parent 91ea2fa commit 2c5ee86

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Python/flowgraph.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,11 +1766,8 @@ optimize_if_const_unaryop(basicblock *bb, int i,
17661766
instr->i_opcode == UNARY_NEGATIVE
17671767
|| instr->i_opcode == UNARY_INVERT
17681768
|| instr->i_opcode == UNARY_NOT
1769-
|| instr->i_opcode == CALL_INTRINSIC_1
1769+
|| (instr->i_opcode == CALL_INTRINSIC_1 && instr->i_oparg == INTRINSIC_UNARY_POSITIVE)
17701770
);
1771-
if (instr->i_opcode == CALL_INTRINSIC_1) {
1772-
assert(instr->i_oparg == INTRINSIC_UNARY_POSITIVE);
1773-
}
17741771
PyObject *seq;
17751772
RETURN_IF_ERROR(get_constant_sequence(bb, i-1, UNARYOP_OPERAND_COUNT, consts, &seq));
17761773
RETURN_SUCCESS_IF_NULL(seq);

0 commit comments

Comments
 (0)
0