diff options
| author | Damien George <damien.p.george@gmail.com> | 2014-06-03 13:40:16 +0100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2014-06-03 13:40:16 +0100 |
| commit | 3f5226246517be2f28d4f23d6e4c202047915f83 (patch) | |
| tree | 2b41b45e06e2b6dd89af217c813021bbdcb1c818 /py/runtime.c | |
| parent | 65ec33200ada958066bea0914120045acdb5e410 (diff) | |
py: Allow tail call optimisation in mp_call_function_n_kw.
This saves 4 words of stack space per Python call.
Diffstat (limited to 'py/runtime.c')
| -rw-r--r-- | py/runtime.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/py/runtime.c b/py/runtime.c index 27a5ed543..f13cc1d89 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -526,10 +526,7 @@ mp_obj_t mp_call_function_n_kw(mp_obj_t fun_in, uint n_args, uint n_kw, const mp // do the call if (type->call != NULL) { - mp_obj_t res = type->call(fun_in, n_args, n_kw, args); - if (res != NULL) { - return res; - } + return type->call(fun_in, n_args, n_kw, args); } nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError, "'%s' object is not callable", mp_obj_get_type_str(fun_in))); |
