[svn:parrot] r40992 - trunk/src/pmc

whiteknight at svn.parrot.org whiteknight at svn.parrot.org
Sat Sep 5 12:46:49 UTC 2009


Author: whiteknight
Date: Sat Sep  5 12:46:48 2009
New Revision: 40992
URL: https://trac.parrot.org/parrot/changeset/40992

Log:
[ctx] small fix in Sub.invoke to reduce calls to Parrot_pcc_get_outer_ctx

Modified:
   trunk/src/pmc/sub.pmc

Modified: trunk/src/pmc/sub.pmc
==============================================================================
--- trunk/src/pmc/sub.pmc	Sat Sep  5 12:45:10 2009	(r40991)
+++ trunk/src/pmc/sub.pmc	Sat Sep  5 12:46:48 2009	(r40992)
@@ -324,10 +324,9 @@
         }
         else {
             /* autoclose */
-            PMC *c;
-            for (c = context;
-                 PMC_IS_NULL(Parrot_pcc_get_outer_ctx(interp, c));
-                 c = Parrot_pcc_get_outer_ctx(interp, c)) {
+            PMC *c = context;
+            PMC *outer_c = Parrot_pcc_get_outer_ctx(interp, c);
+            for (c = context; PMC_IS_NULL(outer_c); c = outer_c) {
 
                 PMC         *outer_pmc;
                 Parrot_Sub_attributes *current_sub, *outer_sub;
@@ -358,6 +357,7 @@
                 }
 
                 Parrot_pcc_set_outer_ctx(interp, c, outer_sub->ctx);
+                outer_c = outer_sub->ctx;
             }
         }
 


More information about the parrot-commits mailing list