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
77092108
Commit
77092108
authored
May 24, 2020
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use "!" instead of the less clear "== 0" when testing for type features.
parent
f9240f2e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+3
-3
No files found.
Cython/Compiler/ModuleNode.py
View file @
77092108
...
...
@@ -1454,7 +1454,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if
is_final_type
:
type_safety_check
=
''
else
:
type_safety_check
=
' & (
__Pyx_PyType_HasFeature(t, (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)) == 0
)'
type_safety_check
=
' & (
!__Pyx_PyType_HasFeature(t, (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE))
)'
obj_struct
=
type
.
declaration_code
(
""
,
deref
=
True
)
code
.
putln
(
"if (CYTHON_COMPILING_IN_CPYTHON && likely((%s > 0) & (t->tp_basicsize == sizeof(%s))%s)) {"
%
(
...
...
@@ -1467,7 +1467,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
"PyObject_GC_Track(o);"
)
code
.
putln
(
"} else {"
)
if
not
is_final_type
:
code
.
putln
(
"if (likely(
__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT) == 0
)) {"
)
code
.
putln
(
"if (likely(
!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT)
)) {"
)
code
.
putln
(
"o = (*t->tp_alloc)(t, 0);"
)
if
not
is_final_type
:
code
.
putln
(
"} else {"
)
...
...
@@ -1660,7 +1660,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
type_safety_check
=
''
else
:
type_safety_check
=
(
' & (
__Pyx_PyType_HasFeature(Py_TYPE(o), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)) == 0
)'
)
' & (
!__Pyx_PyType_HasFeature(Py_TYPE(o), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE))
)'
)
type
=
scope
.
parent_type
code
.
putln
(
...
...
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