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
609870b2
Commit
609870b2
authored
Aug 01, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move less common "except (tuple)" case out of the fast path
parent
94d982d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
Cython/Utility/Exceptions.c
Cython/Utility/Exceptions.c
+14
-11
No files found.
Cython/Utility/Exceptions.c
View file @
609870b2
...
@@ -31,21 +31,24 @@ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tsta
...
@@ -31,21 +31,24 @@ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tsta
/////////////// PyErrExceptionMatches ///////////////
/////////////// PyErrExceptionMatches ///////////////
#if CYTHON_FAST_THREAD_STATE
#if CYTHON_FAST_THREAD_STATE
static
int
__Pyx_PyErr_ExceptionMatchesTuple
(
PyObject
*
exc_type
,
PyObject
*
tuple
)
{
Py_ssize_t
i
,
n
;
n
=
PyTuple_GET_SIZE
(
tuple
);
for
(
i
=
0
;
i
<
n
;
i
++
)
{
if
(
exc_type
==
PyTuple_GET_ITEM
(
tuple
,
i
))
return
1
;
}
for
(
i
=
0
;
i
<
n
;
i
++
)
{
if
(
__Pyx_PyErr_GivenExceptionMatches
(
exc_type
,
PyTuple_GET_ITEM
(
tuple
,
i
)))
return
1
;
}
return
0
;
}
static
CYTHON_INLINE
int
__Pyx_PyErr_ExceptionMatchesInState
(
PyThreadState
*
tstate
,
PyObject
*
err
)
{
static
CYTHON_INLINE
int
__Pyx_PyErr_ExceptionMatchesInState
(
PyThreadState
*
tstate
,
PyObject
*
err
)
{
PyObject
*
exc_type
=
tstate
->
curexc_type
;
PyObject
*
exc_type
=
tstate
->
curexc_type
;
if
(
exc_type
==
err
)
return
1
;
if
(
exc_type
==
err
)
return
1
;
if
(
unlikely
(
!
exc_type
))
return
0
;
if
(
unlikely
(
!
exc_type
))
return
0
;
if
(
unlikely
(
PyTuple_Check
(
err
)))
{
if
(
unlikely
(
PyTuple_Check
(
err
)))
Py_ssize_t
i
,
n
;
return
__Pyx_PyErr_ExceptionMatchesTuple
(
exc_type
,
err
);
n
=
PyTuple_GET_SIZE
(
err
);
for
(
i
=
0
;
i
<
n
;
i
++
)
{
if
(
exc_type
==
PyTuple_GET_ITEM
(
err
,
i
))
return
1
;
}
for
(
i
=
0
;
i
<
n
;
i
++
)
{
if
(
__Pyx_PyErr_GivenExceptionMatches
(
exc_type
,
PyTuple_GET_ITEM
(
err
,
i
)))
return
1
;
}
return
0
;
}
return
__Pyx_PyErr_GivenExceptionMatches
(
exc_type
,
err
);
return
__Pyx_PyErr_GivenExceptionMatches
(
exc_type
,
err
);
}
}
#endif
#endif
...
...
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