8000 polish · python/cpython@f0f044a · GitHub
[go: up one dir, main page]

Skip to content

Commit f0f044a

Browse files
committed
polish
1 parent c93627e commit f0f044a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Python/flowgraph.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,6 +1741,7 @@ unary_not(PyObject *v)
17411741
static PyObject *
17421742
eval_const_unaryop(PyObject *operand, int op, bool unarypos)
17431743
{
1744+
assert(operand != NULL);
17441745
if (unarypos) {
17451746
return PyNumber_Positive(operand);
17461747
}
@@ -1846,6 +1847,7 @@ optimize_unary_not_non_const(basicblock *bb, int i, int nextop)
18461847
}
18471848
return true;
18481849
}
1850+
/* single UNARY_NOT doesn't need TO_BOOL conversion */
18491851
remove_to_bool_sequence(bb, i+1);
18501852
return optimize_unary_not_is_contains(bb, i, nextop);
18511853
}

0 commit comments

Comments
 (0)
0