Apparently avoiding the swapping is too costly.
authorBen Tilly <ben_tilly@operamail.com>
Fri, 1 Sep 2000 20:23:16 +0000 (16:23 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 2 Sep 2000 15:06:14 +0000 (15:06 +0000)
Subject: Re: the door is closed.
Message-ID: <LAW2-F2963JkUwWpSWe00000904@hotmail.com>

p4raw-id: //depot/perl@7004

pod/perlfaq4.pod

index 112b1ed..79905f8 100644 (file)
@@ -1189,7 +1189,6 @@ Use this:
         my $i;
         for ($i = @$array; --$i; ) {
             my $j = int rand ($i+1);
-            next if $i == $j;
             @$array[$i,$j] = @$array[$j,$i];
         }
     }