summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-11-17 12:37:02 +0000
committerDamien George <damien.p.george@gmail.com>2015-11-17 12:37:02 +0000
commitcbd9ae5256731c24a4cebf1b1d9bdbfac5df8792 (patch)
treeacd7cae961b9ec043a1bd50853b5b141cd03eee5 /py
parente4404fbef077a481e58ec0b31dfcf79b521caff6 (diff)
downloadmicropython-cbd9ae5256731c24a4cebf1b1d9bdbfac5df8792.tar.gz
micropython-cbd9ae5256731c24a4cebf1b1d9bdbfac5df8792.zip
py/compile: Don't unnecessarily save state when compiling param list.
Parameter lists can't be nested so there is no need to save the global state when compiling them.
Diffstat (limited to 'py')
-rw-r--r--py/compile.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/py/compile.c b/py/compile.c
index e0561e6c32..7ef25a7b90 100644
--- a/py/compile.c
+++ b/py/compile.c
@@ -663,11 +663,6 @@ STATIC qstr compile_funcdef_helper(compiler_t *comp, mp_parse_node_struct_t *pns
pns->nodes[4] = (mp_parse_node_t)s;
}
- // save variables (probably don't need to do this, since we can't have nested definitions..?)
- uint old_have_star = comp->have_star;
- uint old_num_dict_params = comp->num_dict_params;
- uint old_num_default_params = comp->num_default_params;
-
// compile default parameters
comp->have_star = false;
comp->num_dict_params = 0;
@@ -691,11 +686,6 @@ STATIC qstr compile_funcdef_helper(compiler_t *comp, mp_parse_node_struct_t *pns
// make the function
close_over_variables_etc(comp, fscope, comp->num_default_params, comp->num_dict_params);
- // restore variables
- comp->have_star = old_have_star;
- comp->num_dict_params = old_num_dict_params;
- comp->num_default_params = old_num_default_params;
-
// return its name (the 'f' in "def f(...):")
return fscope->simple_name;
}