Commit 9bc56d93 authored by John R. Lenton's avatar John R. Lenton
Browse files

Changed to use memcpy.

parent aeb16c36
...@@ -51,12 +51,8 @@ static mp_obj_t list_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) { ...@@ -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 *p = rhs;
mp_obj_list_t *s = list_new(o->len + p->len); mp_obj_list_t *s = list_new(o->len + p->len);
for (int i = 0; i < o->len; i++) { memcpy(s->items, o->items, sizeof(mp_obj_t) * o->len);
s->items[i] = o->items[i]; memcpy(s->items + o->len, p->items, sizeof(mp_obj_t) * p->len);
}
for (int i = 0; i < p->len; i++) {
s->items[i + o->len] = p->items[i];
}
return s; return s;
} }
default: default:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment