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
d5b686b6
Commit
d5b686b6
authored
May 14, 2018
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a dedicated C macro for CyFunction type checks instead of repeating the TypeCheck() call.
parent
4a99c52c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
Cython/Utility/CythonFunction.c
Cython/Utility/CythonFunction.c
+3
-1
Cython/Utility/ObjectHandling.c
Cython/Utility/ObjectHandling.c
+3
-2
No files found.
Cython/Utility/CythonFunction.c
View file @
d5b686b6
...
...
@@ -47,6 +47,8 @@ typedef struct {
static
PyTypeObject
*
__pyx_CyFunctionType
=
0
;
#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
__Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
...
...
@@ -1255,7 +1257,7 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
return
PyClassMethod_New
(
method
);
}
#ifdef __Pyx_CyFunction_USED
else
if
(
__Pyx_
TypeCheck
(
method
,
__pyx_CyFunctionType
))
{
else
if
(
__Pyx_
CyFunction_Check
(
method
))
{
return
PyClassMethod_New
(
method
);
}
#endif
...
...
Cython/Utility/ObjectHandling.c
View file @
d5b686b6
...
...
@@ -2234,10 +2234,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
}
#endif
#ifdef __Pyx_CyFunction_USED
if
(
likely
(
PyCFunction_Check
(
func
)
||
__Pyx_
TypeCheck
(
func
,
__pyx_CyFunctionType
)))
{
if
(
likely
(
PyCFunction_Check
(
func
)
||
__Pyx_
CyFunction_Check
(
func
)))
#else
if
(
likely
(
PyCFunction_Check
(
func
)))
{
if
(
likely
(
PyCFunction_Check
(
func
)))
#endif
{
if
(
likely
(
PyCFunction_GET_FLAGS
(
func
)
&
METH_NOARGS
))
{
// fast and simple case that we are optimising for
return
__Pyx_PyObject_CallMethO
(
func
,
NULL
);
...
...
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