Commit 89ebc32d authored by Stefan Behnel's avatar Stefan Behnel

minor code cleanup

parent 0dc738d3
......@@ -1832,8 +1832,6 @@ class IteratorNode(ExprNode):
"if (PyList_CheckExact(%s) || PyTuple_CheckExact(%s)) {" % (
self.sequence.py_result(),
self.sequence.py_result()))
if not is_builtin_sequence:
self.iter_func_ptr = code.funcstate.allocate_temp(self._func_iternext_type, manage_ref=False)
if is_builtin_sequence or self.may_be_a_sequence:
code.putln(
"%s = 0; %s = %s; __Pyx_INCREF(%s);" % (
......@@ -1841,10 +1839,10 @@ class IteratorNode(ExprNode):
self.result(),
self.sequence.py_result(),
self.result()))
if self.iter_func_ptr:
code.putln("%s = NULL;" % self.iter_func_ptr)
if not is_builtin_sequence:
self.iter_func_ptr = code.funcstate.allocate_temp(self._func_iternext_type, manage_ref=False)
if self.may_be_a_sequence:
code.putln("%s = NULL;" % self.iter_func_ptr)
code.putln("} else {")
code.putln("%s = -1; %s = PyObject_GetIter(%s); %s" % (
self.counter_cname,
......
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