develooper Front page | perl.perl5.porters | Postings from June 2004

Re: optimizing Short circuiting sort method based on [M]

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
June 30, 2004 12:41
Subject:
Re: optimizing Short circuiting sort method based on [M]
Message ID:
20040630194831.GA1895@iabyn.com
On Wed, Jun 30, 2004 at 07:58:40PM +0100, Nicholas Clark wrote:
> Does the peephole optimiser currently have any way to optimise
> 
>   @a = reverse sort @b
> 
> into
> 
>   @a = sort {$b cmp $a} $b;
> 
> but without the explicit sort comparison?

Shouldn't be too difficult.

-- 
"Foul and greedy Dwarf - you have eaten the last candle."
    -- "Hordes of the Things", BBC Radio.

Thread Previous | 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