Commit cedb82a7 authored by Stefan Behnel's avatar Stefan Behnel

minor code cleanup

parent 8368e533
...@@ -3011,13 +3011,13 @@ class ConstantFolding(Visitor.VisitorTransform, SkipDeclarations): ...@@ -3011,13 +3011,13 @@ class ConstantFolding(Visitor.VisitorTransform, SkipDeclarations):
return node return node
if not node.operand.is_literal: if not node.operand.is_literal:
return node return node
if isinstance(node, ExprNodes.NotNode): if node.operator == '!':
return ExprNodes.BoolNode(node.pos, value = bool(node.constant_result), return ExprNodes.BoolNode(node.pos, value=bool(node.constant_result),
constant_result = bool(node.constant_result)) constant_result=bool(node.constant_result))
elif isinstance(node.operand, ExprNodes.BoolNode): elif isinstance(node.operand, ExprNodes.BoolNode):
return ExprNodes.IntNode(node.pos, value = str(int(node.constant_result)), return ExprNodes.IntNode(node.pos, value=str(int(node.constant_result)),
type = PyrexTypes.c_int_type, type=PyrexTypes.c_int_type,
constant_result = int(node.constant_result)) constant_result=int(node.constant_result))
elif node.operator == '+': elif node.operator == '+':
return self._handle_UnaryPlusNode(node) return self._handle_UnaryPlusNode(node)
elif node.operator == '-': elif node.operator == '-':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment