diff options
author | Damien George <damien.p.george@gmail.com> | 2016-11-13 15:35:11 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-11-15 16:48:48 +1100 |
commit | ed9c93f0f13fe2b6b4b0fbc1155b1e38ee1be242 (patch) | |
tree | f12e971d90e0a54d50e7a1008b38cc48a3e49c0c /py/compile.c | |
parent | b0cbfb0492028192a28f0514fba71ec954330108 (diff) |
py/parse: Make mp_parse_node_new_leaf an inline function.
It is split into 2 functions, one to make small ints and the other to make
a non-small-int leaf node. This reduces code size by 32 bytes on
bare-arm, 64 bytes on unix (x64-64) and 144 bytes on stmhal.
Diffstat (limited to 'py/compile.c')
-rw-r--r-- | py/compile.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/py/compile.c b/py/compile.c index cd38b07f3..6efd15eff 100644 --- a/py/compile.c +++ b/py/compile.c @@ -1403,13 +1403,13 @@ STATIC void compile_for_stmt(compiler_t *comp, mp_parse_node_struct_t *pns) { if (1 <= n_args && n_args <= 3) { optimize = true; if (n_args == 1) { - pn_range_start = mp_parse_node_new_leaf(MP_PARSE_NODE_SMALL_INT, 0); + pn_range_start = mp_parse_node_new_small_int(0); pn_range_end = args[0]; - pn_range_step = mp_parse_node_new_leaf(MP_PARSE_NODE_SMALL_INT, 1); + pn_range_step = mp_parse_node_new_small_int(1); } else if (n_args == 2) { pn_range_start = args[0]; pn_range_end = args[1]; - pn_range_step = mp_parse_node_new_leaf(MP_PARSE_NODE_SMALL_INT, 1); + pn_range_step = mp_parse_node_new_small_int(1); } else { pn_range_start = args[0]; pn_range_end = args[1]; |