diff options
author | Damien George <damien.p.george@gmail.com> | 2017-04-22 21:43:42 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-04-22 21:43:42 +1000 |
commit | 0dd6a59c895b6de4841b4e372069aa9392c24d5f (patch) | |
tree | 983ead87f7524e5862199febac72d0840326a7da /py | |
parent | 03053f82db8fb79e8f62524948ebc2331c957af8 (diff) | |
download | micropython-0dd6a59c895b6de4841b4e372069aa9392c24d5f.tar.gz micropython-0dd6a59c895b6de4841b4e372069aa9392c24d5f.zip |
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.
Diffstat (limited to 'py')
-rw-r--r-- | py/compile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/py/compile.c b/py/compile.c index ae5c3b2dc8..2110867291 100644 --- a/py/compile.c +++ b/py/compile.c @@ -2833,14 +2833,14 @@ STATIC void compile_scope_comp_iter(compiler_t *comp, mp_parse_node_struct_t *pn } else { EMIT_ARG(store_comp, comp->scope_cur->kind, 4 * for_depth + 5); } - } else if (MP_PARSE_NODE_IS_STRUCT_KIND(pn_iter, PN_comp_if)) { + } else if (MP_PARSE_NODE_STRUCT_KIND((mp_parse_node_struct_t*)pn_iter) == PN_comp_if) { // if condition mp_parse_node_struct_t *pns_comp_if = (mp_parse_node_struct_t*)pn_iter; c_if_cond(comp, pns_comp_if->nodes[0], false, l_top); pn_iter = pns_comp_if->nodes[1]; goto tail_recursion; } else { - assert(MP_PARSE_NODE_IS_STRUCT_KIND(pn_iter, PN_comp_for)); // should be + assert(MP_PARSE_NODE_STRUCT_KIND((mp_parse_node_struct_t*)pn_iter) == PN_comp_for); // should be // for loop mp_parse_node_struct_t *pns_comp_for2 = (mp_parse_node_struct_t*)pn_iter; compile_node(comp, pns_comp_for2->nodes[1]); |