develooper Front page | perl.perl5.porters | Postings from September 2000

Re: the door is closed.

Thread Previous | Thread Next
From:
Ben Tilly
Date:
September 1, 2000 17:23
Subject:
Re: the door is closed.
Message ID:
LAW2-F2963JkUwWpSWe00000904@hotmail.com
>Theory: only documentation fixes can any more get in.

Well this is a documentation fix, based on benchmark results at

http://www.perlmonks.org/index.pl?node_id=30243

It seems that the test is a performance loss, and at a guess that
Tye McQueen made (which I suspect is correct), the only reason
for it is that if you swap an element with itself with an xor,
bad things happen.

Cheers,
Ben

--- perlfaq4.pod.bak    Fri Sep  1 09:03:28 2000
+++ perlfaq4.pod        Fri Sep  1 09:04:11 2000
@@ -1189,7 +1189,6 @@
         my $i;
         for ($i = @$array; --$i; ) {
             my $j = int rand ($i+1);
-            next if $i == $j;
             @$array[$i,$j] = @$array[$j,$i];
         }
     }

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


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