summaryrefslogtreecommitdiff
path: root/py/compile.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-11-13 15:35:11 +1100
committerDamien George <damien.p.george@gmail.com>2016-11-15 16:48:48 +1100
commited9c93f0f13fe2b6b4b0fbc1155b1e38ee1be242 (patch)
treef12e971d90e0a54d50e7a1008b38cc48a3e49c0c /py/compile.c
parentb0cbfb0492028192a28f0514fba71ec954330108 (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.c6
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];