[vala/wip/effectfree: 17/40] codegen: Drop useless temporary variable in array creation
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/effectfree: 17/40] codegen: Drop useless temporary variable in array creation
- Date: Fri, 1 Jul 2011 11:57:20 +0000 (UTC)
commit 21361e2cb73e0f3755fd1ec678978de28370d018
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]