Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
9afe5baa
Commit
9afe5baa
authored
Oct 20, 2011
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use memmove for list.pop(int) optimization (up to 4x speedup).
parent
c9c93943
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
4 deletions
+1
-4
Cython/Utility/Optimize.c
Cython/Utility/Optimize.c
+1
-4
No files found.
Cython/Utility/Optimize.c
View file @
9afe5baa
...
...
@@ -14,13 +14,10 @@ static PyObject* __Pyx_PyObject_PopIndex(PyObject* L, Py_ssize_t ix) {
ix
+=
size
;
}
if
(
likely
(
0
<=
ix
&&
ix
<
size
))
{
Py_ssize_t
i
;
PyObject
*
v
=
PyList_GET_ITEM
(
L
,
ix
);
Py_SIZE
(
L
)
-=
1
;
size
-=
1
;
for
(
i
=
ix
;
i
<
size
;
i
++
)
{
PyList_SET_ITEM
(
L
,
i
,
PyList_GET_ITEM
(
L
,
i
+
1
));
}
memmove
(
&
PyList_GET_ITEM
(
L
,
ix
),
&
PyList_GET_ITEM
(
L
,
ix
+
1
),
(
size
-
ix
)
*
sizeof
(
PyObject
*
));
return
v
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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