Commit 042ff575 authored by Stefan Behnel's avatar Stefan Behnel

minor code cleanup

parent 85cfe7d8
...@@ -1254,9 +1254,8 @@ class UnicodeNode(ConstNode): ...@@ -1254,9 +1254,8 @@ class UnicodeNode(ConstNode):
data_cname, data_cname,
code.error_goto_if_null(self.result_code, self.pos))) code.error_goto_if_null(self.result_code, self.pos)))
code.putln("#if CYTHON_PEP393_ENABLED") code.putln("#if CYTHON_PEP393_ENABLED")
code.putln( code.put_error_if_neg(
code.error_goto_if_neg( self.pos, "PyUnicode_READY(%s)" % self.result_code)
"PyUnicode_READY(%s)" % self.result_code, self.pos))
code.putln("#endif") code.putln("#endif")
else: else:
self.result_code = code.get_py_string_const(self.value) self.result_code = code.get_py_string_const(self.value)
...@@ -2408,7 +2407,7 @@ class WithExitCallNode(ExprNode): ...@@ -2408,7 +2407,7 @@ class WithExitCallNode(ExprNode):
code.put_gotref(result_var) code.put_gotref(result_var)
code.putln("%s = __Pyx_PyObject_IsTrue(%s);" % (self.result(), result_var)) code.putln("%s = __Pyx_PyObject_IsTrue(%s);" % (self.result(), result_var))
code.put_decref_clear(result_var, type=py_object_type) code.put_decref_clear(result_var, type=py_object_type)
code.putln(code.error_goto_if_neg(self.result(), self.pos)) code.put_error_if_neg(self.pos, self.result())
code.funcstate.release_temp(result_var) code.funcstate.release_temp(result_var)
if isinstance(self.args, TupleNode): if isinstance(self.args, TupleNode):
code.putln("}") code.putln("}")
...@@ -6317,10 +6316,9 @@ class SetNode(ExprNode): ...@@ -6317,10 +6316,9 @@ class SetNode(ExprNode):
code.put_gotref(self.py_result()) code.put_gotref(self.py_result())
for arg in self.args: for arg in self.args:
arg.generate_evaluation_code(code) arg.generate_evaluation_code(code)
code.putln( code.put_error_if_neg(
code.error_goto_if_neg( self.pos,
"PySet_Add(%s, %s)" % (self.result(), arg.py_result()), "PySet_Add(%s, %s)" % (self.result(), arg.py_result()))
self.pos))
arg.generate_disposal_code(code) arg.generate_disposal_code(code)
arg.free_temps(code) arg.free_temps(code)
...@@ -6517,8 +6515,8 @@ class SortedDictKeysNode(ExprNode): ...@@ -6517,8 +6515,8 @@ class SortedDictKeysNode(ExprNode):
self.result(), function, dict_result, self.result(), function, dict_result,
code.error_goto_if_null(self.result(), self.pos))) code.error_goto_if_null(self.result(), self.pos)))
code.put_gotref(self.py_result()) code.put_gotref(self.py_result())
code.putln(code.error_goto_if_neg( code.put_error_if_neg(
'PyList_Sort(%s)' % self.py_result(), self.pos)) self.pos, 'PyList_Sort(%s)' % self.py_result())
class ModuleNameMixin(object): class ModuleNameMixin(object):
......
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