Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
81ad89c4
Commit
81ad89c4
authored
Jan 03, 2014
by
John R. Lenton
Browse files
untabified
parent
4cb80582
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/objlist.c
View file @
81ad89c4
...
...
@@ -46,18 +46,18 @@ static mp_obj_t list_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) {
}
case
RT_BINARY_OP_ADD
:
{
if
(
!
MP_OBJ_IS_TYPE
(
rhs
,
&
list_type
))
{
return
NULL
;
}
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
];
}
return
s
;
if
(
!
MP_OBJ_IS_TYPE
(
rhs
,
&
list_type
))
{
return
NULL
;
}
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
];
}
return
s
;
}
default:
// op not supported
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment