[vala/wip/effectfree: 16/38] codegen: Drop useless temporary variable in array creation



commit ea675196bffbd09734b5987426d23657ca602728
Author: Luca Bruno <lucabru src gnome org>
Date:   Sat Jun 18 08:41:41 2011 +0200

    codegen: Drop useless temporary variable in array creation

 codegen/valaccodearraymodule.vala |   15 +--------------
 1 files changed, 1 insertions(+), 14 deletions(-)
---
diff --git a/codegen/valaccodearraymodule.vala b/codegen/valaccodearraymodule.vala
index 869741e..0da3314 100644
--- a/codegen/valaccodearraymodule.vala
+++ b/codegen/valaccodearraymodule.vala
@@ -71,20 +71,7 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule {
 		// iterate over each dimension
 		foreach (Expression size in expr.get_sizes ()) {
 			CCodeExpression csize = get_cvalue (size);
-
-			if (!is_pure_ccode_expression (csize)) {
-				var temp_var = get_temp_variable (int_type, false, expr);
-				var name_cnode = get_variable_cexpression (temp_var.name);
-				set_cvalue (size, name_cnode);
-
-				emit_temp_var (temp_var);
-
-				csize = new CCodeAssignment (name_cnode, csize);
-
-				append_array_length (expr, name_cnode);
-			} else {
-				append_array_length (expr, csize);
-			}
+			append_array_length (expr, csize);
 
 			if (first) {
 				cexpr = csize;



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