Skip to content

Commit 0dd6a59

Browse files
committed
py/compile: Don't do unnecessary check if iter parse node is a struct.
If we get to this point in the code then pn_iter is guaranteed to be a struct.
1 parent 03053f8 commit 0dd6a59

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

py/compile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2833,14 +2833,14 @@ STATIC void compile_scope_comp_iter(compiler_t *comp, mp_parse_node_struct_t *pn
28332833
} else {
28342834
EMIT_ARG(store_comp, comp->scope_cur->kind, 4 * for_depth + 5);
28352835
}
2836-
} else if (MP_PARSE_NODE_IS_STRUCT_KIND(pn_iter, PN_comp_if)) {
2836+
} else if (MP_PARSE_NODE_STRUCT_KIND((mp_parse_node_struct_t*)pn_iter) == PN_comp_if) {
28372837
// if condition
28382838
mp_parse_node_struct_t *pns_comp_if = (mp_parse_node_struct_t*)pn_iter;
28392839
c_if_cond(comp, pns_comp_if->nodes[0], false, l_top);
28402840
pn_iter = pns_comp_if->nodes[1];
28412841
goto tail_recursion;
28422842
} else {
2843-
assert(MP_PARSE_NODE_IS_STRUCT_KIND(pn_iter, PN_comp_for)); // should be
2843+
assert(MP_PARSE_NODE_STRUCT_KIND((mp_parse_node_struct_t*)pn_iter) == PN_comp_for); // should be
28442844
// for loop
28452845
mp_parse_node_struct_t *pns_comp_for2 = (mp_parse_node_struct_t*)pn_iter;
28462846
compile_node(comp, pns_comp_for2->nodes[1]);

0 commit comments

Comments
 (0)