summaryrefslogtreecommitdiffstatshomepage
path: root/py/runtime.c
diff options
context:
space:
mode:
authorKrzysztof Blazewicz <blazewicz.krzysztof@gmail.com>2017-03-06 08:46:21 +0100
committerDamien George <damien.p.george@gmail.com>2017-03-07 16:48:16 +1100
commit1215dc47e2eb8ad3d70e3f1aa1a36a98024019a2 (patch)
tree68e761a9576649b07d10ef0c211fc864c143b460 /py/runtime.c
parent88ffe0d5cc697aea61cee950e6388ef9419df7f4 (diff)
downloadmicropython-1215dc47e2eb8ad3d70e3f1aa1a36a98024019a2.tar.gz
micropython-1215dc47e2eb8ad3d70e3f1aa1a36a98024019a2.zip
py/runtime.c: Remove optimization of '*a,=b', it caused a bug.
*a, = b should always make a copy of b, instead, before this patch if b was a list it would copy only a reference to it.
Diffstat (limited to 'py/runtime.c')
-rw-r--r--py/runtime.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/py/runtime.c b/py/runtime.c
index 1c25350ec4..0f8044c8da 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -854,11 +854,6 @@ void mp_unpack_ex(mp_obj_t seq_in, size_t num_in, mp_obj_t *items) {
if (MP_OBJ_IS_TYPE(seq_in, &mp_type_tuple)) {
mp_obj_tuple_get(seq_in, &seq_len, &seq_items);
} else {
- if (num_left == 0 && num_right == 0) {
- // *a, = b # sets a to b if b is a list
- items[0] = seq_in;
- return;
- }
mp_obj_list_get(seq_in, &seq_len, &seq_items);
}
if (seq_len < num_left + num_right) {