summaryrefslogtreecommitdiffstatshomepage
path: root/py/objlist.c
diff options
context:
space:
mode:
authorJohn R. Lenton <jlenton@gmail.com>2014-01-03 10:13:38 +0000
committerJohn R. Lenton <jlenton@gmail.com>2014-01-03 10:13:38 +0000
commit9bc56d933f885d4231e047a25af2becbb1354ce3 (patch)
tree3b53ad251ea01da0c31ee866919b26803400d861 /py/objlist.c
parentaeb16c36b0f77acd10e8228b7e9e5582c9e0d0ee (diff)
downloadmicropython-9bc56d933f885d4231e047a25af2becbb1354ce3.tar.gz
micropython-9bc56d933f885d4231e047a25af2becbb1354ce3.zip
Changed to use memcpy.
Diffstat (limited to 'py/objlist.c')
-rw-r--r--py/objlist.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/py/objlist.c b/py/objlist.c
index 31f04f2ce6..5d4e8c03ab 100644
--- a/py/objlist.c
+++ b/py/objlist.c
@@ -51,12 +51,8 @@ static mp_obj_t list_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) {
}
mp_obj_list_t *p = rhs;
mp_obj_list_t *s = list_new(o->len + p->len);
- for (int i = 0; i < o->len; i++) {
- s->items[i] = o->items[i];
- }
- for (int i = 0; i < p->len; i++) {
- s->items[i + o->len] = p->items[i];
- }
+ memcpy(s->items, o->items, sizeof(mp_obj_t) * o->len);
+ memcpy(s->items + o->len, p->items, sizeof(mp_obj_t) * p->len);
return s;
}
default: