Skip to content

Commit e167770

Browse files
committed
address review: use replace op instead
1 parent a405ca7 commit e167770

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Python/optimizer_bytecodes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2075,7 +2075,7 @@ dummy_func(void) {
20752075
PyTypeObject *type = sym_get_type(subject);
20762076
if (type != NULL) {
20772077
int match = type->tp_flags & Py_TPFLAGS_MAPPING;
2078-
res = sym_new_const(ctx, match ? Py_True : Py_False);
2078+
REPLACE_OP(this_instr, _LOAD_COMMON_CONST, match? CONSTANT_TRUE : CONSTANT_FALSE, 0);
20792079
}
20802080
else {
20812081
res = sym_new_type(ctx, &PyBool_Type);
@@ -2086,7 +2086,7 @@ dummy_func(void) {
20862086
PyTypeObject *type = sym_get_type(subject);
20872087
if (type != NULL) {
20882088
int match = type->tp_flags & Py_TPFLAGS_SEQUENCE;
2089-
res = sym_new_const(ctx, match ? Py_True : Py_False);
2089+
REPLACE_OP(this_instr, _LOAD_COMMON_CONST, match? CONSTANT_TRUE : CONSTANT_FALSE, 0);
20902090
}
20912091
else {
20922092
res = sym_new_type(ctx, &PyBool_Type);

Python/optimizer_cases.c.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)