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
Gwenaël Samain
cython
Commits
da626ecf
Commit
da626ecf
authored
Dec 21, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid performance regression in Py<3.6 for dict.pop().
parent
2af10fb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
Cython/Utility/Optimize.c
Cython/Utility/Optimize.c
+13
-9
No files found.
Cython/Utility/Optimize.c
View file @
da626ecf
...
...
@@ -272,21 +272,25 @@ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *ke
/////////////// py_dict_pop.proto ///////////////
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B3
#define __Pyx_PyDict_Pop(d, key, default_value) _PyDict_Pop(d, key, default_value)
#else
static
CYTHON_INLINE
PyObject
*
__Pyx_PyDict_Pop
(
PyObject
*
d
,
PyObject
*
key
,
PyObject
*
default_value
);
/*proto*/
#endif
/////////////// py_dict_pop ///////////////
//@requires: ObjectHandling.c::PyObjectCallMethod1
//@requires: ObjectHandling.c::PyObjectCallMethod2
#if !(CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B3)
static
CYTHON_INLINE
PyObject
*
__Pyx_PyDict_Pop
(
PyObject
*
d
,
PyObject
*
key
,
PyObject
*
default_value
)
{
// 'default_value' can be NULL
return
PyObject_CallMethodObjArgs
(
d
,
PYIDENT
(
"pop"
),
key
,
default_value
,
NULL
);
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B3
if
((
1
))
{
return
_PyDict_Pop
(
d
,
key
,
default_value
);
}
else
// avoid "function unused" warnings
#endif
if
(
default_value
)
{
return
__Pyx_PyObject_CallMethod2
(
d
,
PYIDENT
(
"pop"
),
key
,
default_value
);
}
else
{
return
__Pyx_PyObject_CallMethod1
(
d
,
PYIDENT
(
"pop"
),
key
);
}
}
/////////////// dict_iter.proto ///////////////
...
...
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