Skip to content

Commit a405ca7

Browse files
committed
address review
1 parent c366767 commit a405ca7

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Python/optimizer_bytecodes.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2072,21 +2072,21 @@ dummy_func(void) {
20722072
}
20732073

20742074
op(_MATCH_MAPPING, (subject -- subject, res)) {
2075-
if (sym_has_type(subject)) {
2076-
PyTypeObject *type = sym_get_type(subject);
2075+
PyTypeObject *type = sym_get_type(subject);
2076+
if (type != NULL) {
20772077
int match = type->tp_flags & Py_TPFLAGS_MAPPING;
2078-
res = match ? sym_new_const(ctx, Py_True) : sym_new_const(ctx, Py_False);
2078+
res = sym_new_const(ctx, match ? Py_True : Py_False);
20792079
}
20802080
else {
20812081
res = sym_new_type(ctx, &PyBool_Type);
20822082
}
20832083
}
20842084

20852085
op(_MATCH_SEQUENCE, (subject -- subject, res)) {
2086-
if (sym_has_type(subject)) {
2087-
PyTypeObject *type = sym_get_type(subject);
2086+
PyTypeObject *type = sym_get_type(subject);
2087+
if (type != NULL) {
20882088
int match = type->tp_flags & Py_TPFLAGS_SEQUENCE;
2089-
res = match ? sym_new_const(ctx, Py_True) : sym_new_const(ctx, Py_False);
2089+
res = sym_new_const(ctx, match ? Py_True : Py_False);
20902090
}
20912091
else {
20922092
res = sym_new_type(ctx, &PyBool_Type);

Python/optimizer_cases.c.h

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

0 commit comments

Comments
 (0)