Skip to content

Commit fa03bbf

Browse files
committed
py/compile: Don't do unnecessary check if parse node is a struct.
PN_atom_expr_normal parse nodes always have structs for their second sub-node, so simplify the check for the sub-node kind to save code size.
1 parent 4df013c commit fa03bbf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

py/compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1422,7 +1422,7 @@ STATIC void compile_for_stmt(compiler_t *comp, mp_parse_node_struct_t *pns) {
14221422
mp_parse_node_struct_t *pns_it = (mp_parse_node_struct_t*)pns->nodes[1];
14231423
if (MP_PARSE_NODE_IS_ID(pns_it->nodes[0])
14241424
&& MP_PARSE_NODE_LEAF_ARG(pns_it->nodes[0]) == MP_QSTR_range
1425-
&& MP_PARSE_NODE_IS_STRUCT_KIND(pns_it->nodes[1], PN_trailer_paren)) {
1425+
&& MP_PARSE_NODE_STRUCT_KIND((mp_parse_node_struct_t*)pns_it->nodes[1]) == PN_trailer_paren) {
14261426
mp_parse_node_t pn_range_args = ((mp_parse_node_struct_t*)pns_it->nodes[1])->nodes[0];
14271427
mp_parse_node_t *args;
14281428
int n_args = mp_parse_node_extract_list(&pn_range_args, PN_arglist, &args);

0 commit comments

Comments
 (0)