[vala/emit-let: 2/2] codegen: Drop useless comma expression when using chained expressions



commit 054d9632ab4b106c75dbde02b37ecbac1b88c10a
Author: Luca Bruno <lucabru src gnome org>
Date:   Sat Mar 5 11:04:21 2011 +0100

    codegen: Drop useless comma expression when using chained expressions

 codegen/valaccodebasemodule.vala |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 2df1409..5cacf96 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -4843,16 +4843,14 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 			var temp_decl = get_temp_variable (lbe.right.value_type, true, null, false);
 			emit_temp_var (temp_decl);
 			var cvar = get_variable_cexpression (temp_decl.name);
-			var ccomma = new CCodeCommaExpression ();
 			var clbe = (CCodeBinaryExpression) get_cvalue (lbe);
 			if (lbe.chained) {
 				clbe = (CCodeBinaryExpression) clbe.right;
 			}
-			ccomma.append_expression (new CCodeAssignment (cvar, get_cvalue (lbe.right)));
+			ccode.add_assignment (cvar, get_cvalue (lbe.right));
 			clbe.right = get_variable_cexpression (temp_decl.name);
-			ccomma.append_expression (cleft);
+			left_chain = cleft;
 			cleft = cvar;
-			left_chain = ccomma;
 		}
 
 		CCodeBinaryOperator op;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]