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

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

Thread Previous | Thread Next
From:
Glenn Linderman
Date:
July 1, 2004 13:51
Subject:
Re: optimizing Short circuiting sort method based on [M]
Message ID:
40E4791F.3010401@nevcal.com
On approximately 7/1/2004 3:02 AM, came the following characters from
the keyboard of Orton, Yves:

> I think this is not unusual nor are top N. The only thing is the later is
> IMO more often written like
> 
>   @array=(sort @foo)[0..9];
> 
> And not like
> 
>   ($one,$two,$three)=sort @foo;
> 
> As for anything more than a few elements the latter style is a real pain.
> Dunno if this is an important consideration but I thought I'd point it out.

That is another type of source for "hint", and thanks for pointing out 
the technique.

-- 
Glenn -- http://nevcal.com/
===========================
The best part about procrastination is that you are never bored,
because you have all kinds of things that you should be doing.


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