diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-21 21:54:15 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-21 21:54:15 +0000 |
commit | 12eaccacda83a15500dae4616b3c37deecb57182 (patch) | |
tree | 5ec75424388c0be9e3591f981982d891c07669cc /py/objlist.c | |
parent | 55baff4c9bcbc001cbb8972c289ebfa356d4665b (diff) | |
parent | 7280f790881fa174e4d234266ff42f0fe3d847bc (diff) |
Merge branch 'master' of github.com:micropython/micropython
Conflicts:
py/objstr.c
py/py.mk
py/stream.c
unix/main.c
unix/socket.c
Diffstat (limited to 'py/objlist.c')
-rw-r--r-- | py/objlist.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/py/objlist.c b/py/objlist.c index bc363d38f..2e9a8705f 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -153,13 +153,8 @@ static mp_obj_t list_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) { return NULL; } int n = MP_OBJ_SMALL_INT_VALUE(rhs); - int len = o->len; - mp_obj_list_t *s = list_new(len * n); - mp_obj_t *dest = s->items; - for (int i = 0; i < n; i++) { - memcpy(dest, o->items, sizeof(mp_obj_t) * len); - dest += len; - } + mp_obj_list_t *s = list_new(o->len * n); + mp_seq_multiply(o->items, sizeof(*o->items), o->len, n, s->items); return s; } case RT_COMPARE_OP_EQUAL: |