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
Xavier Thompson
cython
Commits
3ff46855
Commit
3ff46855
authored
Apr 13, 2020
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce some overhead in the fused function selection code.
parent
8c7c5a47
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
Cython/Utility/CythonFunction.c
Cython/Utility/CythonFunction.c
+12
-13
No files found.
Cython/Utility/CythonFunction.c
View file @
3ff46855
...
...
@@ -1135,7 +1135,13 @@ __pyx_FusedFunction_descr_get(PyObject *self, PyObject *obj, PyObject *type)
static
PyObject
*
_obj_to_str
(
PyObject
*
obj
)
{
if
(
PyType_Check
(
obj
))
if
(
PyUnicode_CheckExact
(
obj
))
return
__Pyx_NewRef
(
obj
);
#if PY_MAJOR_VERSION == 2
else
if
(
PyString_CheckExact
(
obj
))
return
__Pyx_NewRef
(
obj
);
#endif
else
if
(
PyType_Check
(
obj
))
return
PyObject_GetAttr
(
obj
,
PYIDENT
(
"__name__"
));
else
return
PyObject_Str
(
obj
);
...
...
@@ -1154,16 +1160,14 @@ __pyx_FusedFunction_getitem(__pyx_FusedFunctionObject *self, PyObject *idx)
}
if
(
PyTuple_Check
(
idx
))
{
PyObject
*
list
=
PyList_New
(
0
);
Py_ssize_t
n
=
PyTuple_GET_SIZE
(
idx
);
PyObject
*
sep
=
NULL
;
PyObject
*
list
=
PyList_New
(
n
)
;
int
i
;
if
(
unlikely
(
!
list
))
return
NULL
;
for
(
i
=
0
;
i
<
n
;
i
++
)
{
int
ret
;
PyObject
*
string
;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
PyObject
*
item
=
PyTuple_GET_ITEM
(
idx
,
i
);
...
...
@@ -1175,18 +1179,13 @@ __pyx_FusedFunction_getitem(__pyx_FusedFunctionObject *self, PyObject *idx)
Py_DECREF
(
item
);
#endif
if
(
unlikely
(
!
string
))
goto
__pyx_err
;
ret
=
PyList_Append
(
list
,
string
);
Py_DECREF
(
string
);
if
(
unlikely
(
ret
<
0
))
goto
__pyx_err
;
PyList_SET_ITEM
(
list
,
i
,
string
);
}
sep
=
PyUnicode_FromString
(
"|"
);
if
(
likely
(
sep
))
signature
=
PyUnicode_Join
(
sep
,
list
);
__pyx_err:
;
signature
=
PyUnicode_Join
(
PYUNICODE
(
"|"
),
list
);
signature
=
PyUnicode_Join
(
PYUNICODE
(
"|"
),
list
);
__pyx_err:
;
Py_DECREF
(
list
);
Py_XDECREF
(
sep
);
}
else
{
signature
=
_obj_to_str
(
idx
);
}
...
...
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