Commit 38d27e92 authored by Stefan Behnel's avatar Stefan Behnel

skip None checks on a node if we know its constant value as being not None

parent 51e3a151
...@@ -651,7 +651,11 @@ class ExprNode(Node): ...@@ -651,7 +651,11 @@ class ExprNode(Node):
return self.result_in_temp() return self.result_in_temp()
def may_be_none(self): def may_be_none(self):
return self.type.is_pyobject if not self.type.is_pyobject:
return False
if self.constant_result not in (not_a_constant, constant_value_not_set):
return self.constant_result is not None
return True
def as_cython_attribute(self): def as_cython_attribute(self):
return None return None
......
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