diff options
author | Damien George <damien.p.george@gmail.com> | 2017-04-22 14:13:37 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-04-22 14:13:37 +1000 |
commit | fa03bbf0fd0a2f5a5c21472a56e39ba60f7f58dd (patch) | |
tree | adf618fadaaee1210f95fe4933cec60e3d11af79 /py | |
parent | 4df013c8ccf2e122a1bd3dd75d3937d46019409a (diff) | |
download | micropython-fa03bbf0fd0a2f5a5c21472a56e39ba60f7f58dd.tar.gz micropython-fa03bbf0fd0a2f5a5c21472a56e39ba60f7f58dd.zip |
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.
Diffstat (limited to 'py')
-rw-r--r-- | py/compile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/compile.c b/py/compile.c index cf9e5079b0..b114f8962c 100644 --- a/py/compile.c +++ b/py/compile.c @@ -1422,7 +1422,7 @@ STATIC void compile_for_stmt(compiler_t *comp, mp_parse_node_struct_t *pns) { mp_parse_node_struct_t *pns_it = (mp_parse_node_struct_t*)pns->nodes[1]; if (MP_PARSE_NODE_IS_ID(pns_it->nodes[0]) && MP_PARSE_NODE_LEAF_ARG(pns_it->nodes[0]) == MP_QSTR_range - && MP_PARSE_NODE_IS_STRUCT_KIND(pns_it->nodes[1], PN_trailer_paren)) { + && MP_PARSE_NODE_STRUCT_KIND((mp_parse_node_struct_t*)pns_it->nodes[1]) == PN_trailer_paren) { mp_parse_node_t pn_range_args = ((mp_parse_node_struct_t*)pns_it->nodes[1])->nodes[0]; mp_parse_node_t *args; int n_args = mp_parse_node_extract_list(&pn_range_args, PN_arglist, &args); |