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
24549d0c
Commit
24549d0c
authored
Dec 10, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use normal constant calculation for special case to avoid inconsistencies
parent
1cae6142
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+5
-6
No files found.
Cython/Compiler/Optimize.py
View file @
24549d0c
...
...
@@ -3284,12 +3284,6 @@ class ConstantFolding(Visitor.VisitorTransform, SkipDeclarations):
return
sequence_node
def
visit_PrimaryCmpNode
(
self
,
node
):
if
not
node
.
cascade
:
self
.
_calculate_const
(
node
)
if
node
.
has_constant_result
():
return
self
.
_bool_node
(
node
,
node
.
constant_result
)
return
node
# calculate constant partial results in the comparison cascade
left_node
=
node
.
operand1
self
.
_calculate_const
(
left_node
)
...
...
@@ -3306,6 +3300,11 @@ class ConstantFolding(Visitor.VisitorTransform, SkipDeclarations):
left_node
=
right_node
cmp_node
=
cmp_node
.
cascade
if
not
node
.
cascade
:
if
node
.
has_constant_result
():
return
self
.
_bool_node
(
node
,
node
.
constant_result
)
return
node
# collect partial cascades: [[value, CmpNode...], [value, CmpNode, ...], ...]
cascades
=
[[
node
.
operand1
]]
...
...
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