Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Frederik Hennig
pystencils
Commits
cad63a53
Commit
cad63a53
authored
May 03, 2022
by
Markus Holzer
Browse files
Fix conditional simplification
parent
1acd3925
Changes
1
Hide whitespace changes
Inline
Side-by-side
pystencils/transformations.py
View file @
cad63a53
...
...
@@ -773,7 +773,7 @@ def simplify_conditionals(node: ast.Node, loop_counter_simplification: bool = Fa
"""
for
conditional
in
node
.
atoms
(
ast
.
Conditional
):
# TODO simplify conditional before the type system! Casts make it very hard here
conditional
.
condition_expr
=
sp
.
simplify
(
conditional
.
condition_expr
)
#
conditional.condition_expr = sp.simplify(conditional.condition_expr)
if
conditional
.
condition_expr
==
sp
.
true
:
conditional
.
parent
.
replace
(
conditional
,
[
conditional
.
true_block
])
elif
conditional
.
condition_expr
==
sp
.
false
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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