diff options
author | Krzysztof Blazewicz <blazewicz.krzysztof@gmail.com> | 2017-03-04 12:29:20 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-03-07 16:48:16 +1100 |
commit | 7e480e8a30e5e293586bd4806f02a481a08648ca (patch) | |
tree | 86862127caf3443c4ce19418a2f4af971181eb22 /py/objfun.c | |
parent | 1215dc47e2eb8ad3d70e3f1aa1a36a98024019a2 (diff) |
py: Use mp_obj_get_array where sequence may be a tuple or a list.
Diffstat (limited to 'py/objfun.c')
-rw-r--r-- | py/objfun.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/py/objfun.c b/py/objfun.c index e5f6009dc..a823f49e5 100644 --- a/py/objfun.c +++ b/py/objfun.c @@ -511,17 +511,11 @@ STATIC mp_uint_t convert_obj_for_inline_asm(mp_obj_t obj) { // convert float to int (could also pass in float registers) return (mp_int_t)mp_obj_float_get(obj); #endif - } else if (type == &mp_type_tuple) { + } else if (type == &mp_type_tuple || type == &mp_type_list) { // pointer to start of tuple (could pass length, but then could use len(x) for that) mp_uint_t len; mp_obj_t *items; - mp_obj_tuple_get(obj, &len, &items); - return (mp_uint_t)items; - } else if (type == &mp_type_list) { - // pointer to start of list (could pass length, but then could use len(x) for that) - mp_uint_t len; - mp_obj_t *items; - mp_obj_list_get(obj, &len, &items); + mp_obj_get_array(obj, &len, &items); return (mp_uint_t)items; } else { mp_buffer_info_t bufinfo; |