develooper Front page | perl.perl5.porters | Postings from March 2001

[PATCH @9452] Better peep()ing for foreach() loops

Thread Next
From:
Stephen McCamant
Date:
March 29, 2001 18:50
Subject:
[PATCH @9452] Better peep()ing for foreach() loops
Message ID:
15043.62129.253487.470281@soda.csua.berkeley.edu
In a previous patch I fixed peep() so that it would skip over NULLs in 
the last, next, and redo pointers of loops, but I didn't notice that
the code I was modifying only handled while and for(;;) sorts of
loops. This patch makes the change apply to foreach loops too. In
theory this should provide a small performance improvement, but it
isn't large enough to be noticeable.

Thanks to Robin Houston for (indirectly) bringing this to my
attention.

 -- Stephen McC

--- op.c.orig	Thu Mar 29 18:18:49 2001
+++ op.c	Thu Mar 29 18:19:58 2001
@@ -6854,6 +6854,7 @@
 	    break;
 
 	case OP_ENTERLOOP:
+	case OP_ENTERITER:
 	    o->op_seq = PL_op_seqmax++;
 	    while (cLOOP->op_redoop->op_type == OP_NULL)
 		cLOOP->op_redoop = cLOOP->op_redoop->op_next;

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About