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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
0ff0af9c
Commit
0ff0af9c
authored
Jun 30, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
speed up __Pyx_SetItemInt() and __Pyx_DelItemInt() in PyPy
parent
a6c10b1a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+10
-3
No files found.
Cython/Compiler/ExprNodes.py
View file @
0ff0af9c
...
...
@@ -10004,13 +10004,15 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje
Py_DECREF(old);
return 1;
}
} else
#endif
if (likely(i >= 0)) {
} else if (likely(i >= 0)) {
PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
if (likely(m && m->sq_ass_item)) {
return m->sq_ass_item(o, i, v);
}
} else
#endif
if (PySequence_Check(o)) {
return PySequence_SetItem(o, i, v);
}
return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}
...
...
@@ -10035,12 +10037,17 @@ static CYTHON_INLINE int __Pyx_DelItem_Generic(PyObject *o, PyObject *j) {
}
static CYTHON_INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_PYPY
if (PySequence_Check(o))
return PySequence_DelItem(o, i);
#else
if (likely(i >= 0)) {
PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
if (likely(m && m->sq_ass_item)) {
return m->sq_ass_item(o, i, (PyObject *)NULL);
}
}
#endif
return __Pyx_DelItem_Generic(o, PyInt_FromSsize_t(i));
}
"""
,
...
...
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