[svn:parrot] r40667 - trunk/runtime/parrot/library/PGE

coke at svn.parrot.org coke at svn.parrot.org
Wed Aug 19 23:36:59 UTC 2009


Author: coke
Date: Wed Aug 19 23:36:58 2009
New Revision: 40667
URL: https://trac.parrot.org/parrot/changeset/40667

Log:
Minor optimization - don't create a PMC if we don't need it.

Patch courtesy chromatic++

Modified:
   trunk/runtime/parrot/library/PGE/Text.pir

Modified: trunk/runtime/parrot/library/PGE/Text.pir
==============================================================================
--- trunk/runtime/parrot/library/PGE/Text.pir	Wed Aug 19 23:29:34 2009	(r40666)
+++ trunk/runtime/parrot/library/PGE/Text.pir	Wed Aug 19 23:36:58 2009	(r40667)
@@ -50,7 +50,6 @@
     .local int balanced                            # in balanced match
     .local pmc stack                               # lookket backtracking
 
-    stack = new 'ResizableStringArray'
     $P0 = get_hll_global ['PGE'], 'Match'
     (mob, pos, target) = $P0.'new'(tgt)
     from = pos
@@ -88,6 +87,7 @@
     if $I0 < 0 goto end                            # no leading delim fails
     lookket = ''
     balanced = 1
+    stack = new 'ResizableStringArray'
   next:
     $S0 = substr target, pos, 1                    # check current pos
     if $S0 == '' goto fail                         # end of string -> fail


More information about the parrot-commits mailing list