]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Reduce the number of temporary variables
authorLuca Bruno <lucabru@src.gnome.org>
Sat, 25 Jan 2014 14:55:05 +0000 (15:55 +0100)
committerLuca Bruno <lucabru@src.gnome.org>
Sat, 25 Jan 2014 14:55:05 +0000 (15:55 +0100)
If a temporary variable has been generated internally,
do not create another regardless of whether it's floating or not.

codegen/valaccodememberaccessmodule.vala

index 82f9d06adc3e9847ab15fd1be73351101c2513ad..afe81042cd1afecb148a126498dc0c020350af5a 100644 (file)
@@ -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;
                }