[vala] codegen: Reduce the number of temporary variables



commit e9eb1ebb8f4911144628c793707db86af7c2e26c
Author: Luca Bruno <lucabru src gnome org>
Date:   Sat Jan 25 15:55:05 2014 +0100

    codegen: Reduce the number of temporary variables
    
    If a temporary variable has been generated internally,
    do not create another regardless of whether it's floating or not.

 codegen/valaccodememberaccessmodule.vala |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/codegen/valaccodememberaccessmodule.vala b/codegen/valaccodememberaccessmodule.vala
index 82f9d06..afe8104 100644
--- a/codegen/valaccodememberaccessmodule.vala
+++ b/codegen/valaccodememberaccessmodule.vala
@@ -724,9 +724,9 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
                        use_temp = false;
                }
                var local = variable as LocalVariable;
-               if (local != null && local.floating) {
-                       // floating locals are generated internally and safe to
-                       // access without temporary variable
+               if (local != null && local.name[0] == '.') {
+                       // already a temporary variable generated internally
+                       // and safe to access without temporary variable
                        use_temp = false;
                }
 


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