From: Stefan Behnel Date: Tue, 14 Dec 2010 08:00:14 +0000 (+0100) Subject: actually, drop the comments, they don't tell much anyway X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6d88e945e2ddb182b298e69e04bb02684866b23d;p=cython.git actually, drop the comments, they don't tell much anyway --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index ab31ec6c..7b7160d4 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -5007,15 +5007,12 @@ class YieldExprNode(ExprNode): code.put_init_to_py_none(Naming.retval_cname, py_object_type) saved = [] code.temp_allocator.reset() - temps_in_use = code.funcstate.temps_in_use() - if temps_in_use: - code.putln('/* Save temporary variables */') - for cname, type, manage_ref in temps_in_use: - save_cname = code.temp_allocator.allocate_temp(type) - saved.append((cname, save_cname, type)) - if type.is_pyobject: - code.put_xgiveref(cname) - code.putln('%s->%s = %s;' % (Naming.cur_scope_cname, save_cname, cname)) + for cname, type, manage_ref in code.funcstate.temps_in_use(): + save_cname = code.temp_allocator.allocate_temp(type) + saved.append((cname, save_cname, type)) + if type.is_pyobject: + code.put_xgiveref(cname) + code.putln('%s->%s = %s;' % (Naming.cur_scope_cname, save_cname, cname)) code.put_xgiveref(Naming.retval_cname) code.put_finish_refcount_context() @@ -5023,14 +5020,12 @@ class YieldExprNode(ExprNode): code.putln("%s->%s.resume_label = %d;" % (Naming.cur_scope_cname, Naming.obj_base_cname, self.label_num)) code.putln("return %s;" % Naming.retval_cname); code.put_label(self.label_name) - if saved: - code.putln('/* Restore temporary variables */') - for cname, save_cname, type in saved: - code.putln('%s = %s->%s;' % (cname, Naming.cur_scope_cname, save_cname)) - if type.is_pyobject: - code.putln('%s->%s = 0;' % (Naming.cur_scope_cname, save_cname)) - if type.is_pyobject: - code.put_xgotref(cname) + for cname, save_cname, type in saved: + code.putln('%s = %s->%s;' % (cname, Naming.cur_scope_cname, save_cname)) + if type.is_pyobject: + code.putln('%s->%s = 0;' % (Naming.cur_scope_cname, save_cname)) + if type.is_pyobject: + code.put_xgotref(cname) if self.result_is_used: self.allocate_temp_result(code) code.putln('%s = %s; %s' %