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

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

Thread Previous
From:
Jarkko Hietaniemi
Date:
March 29, 2001 18:56
Subject:
Re: [PATCH @9452] Better peep()ing for foreach() loops
Message ID:
20010329205602.L20732@chaos.wustl.edu
On Thu, Mar 29, 2001 at 06:50:45PM -0800, Stephen McCamant wrote:
> 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.

Thanks, applied.

>  -- 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;

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Thread Previous


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