Commit af0741b7 authored by Stefan Behnel's avatar Stefan Behnel

fix warning on unused utility code after enumerate() optimisation

parent 3aecc982
...@@ -3000,7 +3000,6 @@ class SequenceNode(ExprNode): ...@@ -3000,7 +3000,6 @@ class SequenceNode(ExprNode):
self.unpacked_items.append(unpacked_item) self.unpacked_items.append(unpacked_item)
self.coerced_unpacked_items.append(coerced_unpacked_item) self.coerced_unpacked_items.append(coerced_unpacked_item)
self.type = py_object_type self.type = py_object_type
env.use_utility_code(unpacking_utility_code)
def generate_result_code(self, code): def generate_result_code(self, code):
self.generate_operation_code(code) self.generate_operation_code(code)
...@@ -3020,6 +3019,8 @@ class SequenceNode(ExprNode): ...@@ -3020,6 +3019,8 @@ class SequenceNode(ExprNode):
# allocates the temps in a rather hacky way -- the assignment # allocates the temps in a rather hacky way -- the assignment
# is evaluated twice, within each if-block. # is evaluated twice, within each if-block.
code.globalstate.use_utility_code(unpacking_utility_code)
if rhs.type is tuple_type: if rhs.type is tuple_type:
tuple_check = "likely(%s != Py_None)" tuple_check = "likely(%s != Py_None)"
else: else:
...@@ -3092,6 +3093,8 @@ class SequenceNode(ExprNode): ...@@ -3092,6 +3093,8 @@ class SequenceNode(ExprNode):
code.putln("}") code.putln("}")
def generate_starred_assignment_code(self, rhs, code): def generate_starred_assignment_code(self, rhs, code):
code.globalstate.use_utility_code(unpacking_utility_code)
for i, arg in enumerate(self.args): for i, arg in enumerate(self.args):
if arg.is_starred: if arg.is_starred:
starred_target = self.unpacked_items[i] starred_target = self.unpacked_items[i]
......
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