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
48bf6b3b
Commit
48bf6b3b
authored
Apr 27, 2014
by
Paul Sokolovsky
Browse files
objlist: Use static small int constructor.
parent
708c0732
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/objlist.c
View file @
48bf6b3b
...
...
@@ -196,7 +196,7 @@ STATIC mp_obj_t list_pop(uint n_args, const mp_obj_t *args) {
if
(
self
->
len
==
0
)
{
nlr_raise
(
mp_obj_new_exception_msg
(
&
mp_type_IndexError
,
"pop from empty list"
));
}
uint
index
=
mp_get_index
(
self
->
base
.
type
,
self
->
len
,
n_args
==
1
?
mp_obj_new_int
(
-
1
)
:
args
[
1
],
false
);
uint
index
=
mp_get_index
(
self
->
base
.
type
,
self
->
len
,
n_args
==
1
?
MP_OBJ_NEW_SMALL_INT
(
-
1
)
:
args
[
1
],
false
);
mp_obj_t
ret
=
self
->
items
[
index
];
self
->
len
-=
1
;
memcpy
(
self
->
items
+
index
,
self
->
items
+
index
+
1
,
(
self
->
len
-
index
)
*
sizeof
(
mp_obj_t
));
...
...
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