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
8bd40d68
Commit
8bd40d68
authored
Mar 22, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change optimisation order as for N in (2**N) it is much more likely to be an int than a long in Py2
parent
bad722a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
Cython/Utility/Optimize.c
Cython/Utility/Optimize.c
+5
-4
No files found.
Cython/Utility/Optimize.c
View file @
8bd40d68
...
...
@@ -442,6 +442,11 @@ static PyObject* __Pyx__PyNumber_PowerOf2(PyObject *two, PyObject *exp, PyObject
// see http://bugs.python.org/issue21420
#if CYTHON_COMPILING_IN_CPYTHON
Py_ssize_t
shiftby
;
#if PY_MAJOR_VERSION < 3
if
(
likely
(
PyInt_CheckExact
(
exp
)))
{
shiftby
=
PyInt_AS_LONG
(
exp
);
}
else
#endif
if
(
likely
(
PyLong_CheckExact
(
exp
)))
{
#if PY_MAJOR_VERSION >= 3 && CYTHON_USE_PYLONG_INTERNALS
switch
(
Py_SIZE
(
exp
))
{
...
...
@@ -454,10 +459,6 @@ static PyObject* __Pyx__PyNumber_PowerOf2(PyObject *two, PyObject *exp, PyObject
#else
shiftby
=
PyLong_AsSsize_t
(
exp
);
#endif
#if PY_MAJOR_VERSION < 3
}
else
if
(
likely
(
PyInt_CheckExact
(
exp
)))
{
shiftby
=
PyInt_AS_LONG
(
exp
);
#endif
}
else
{
goto
fallback
;
}
...
...
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