diff options
author | Nicholas Clark <nick@ccl4.org> | 2001-05-25 23:40:19 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-05-26 13:15:40 +0000 |
commit | c16425f1b01347226d2386c029d71b356d39092d (patch) | |
tree | 36a7c55e97e26aef2692d4766cc83933366a46c9 /pod | |
parent | 06759ea031c43fa8236d70242f3d2f6e2fddd408 (diff) | |
download | perl-c16425f1b01347226d2386c029d71b356d39092d.tar.gz |
Re: stability of sort()?
Message-ID: <20010525224019.B86445@plum.flirble.org>
p4raw-id: //depot/perl@10215
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perlfunc.pod | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index c2b9f39f66..2fa645d9c2 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -4291,6 +4291,12 @@ loop control operators described in L<perlsyn> or with C<goto>. When C<use locale> is in effect, C<sort LIST> sorts LIST according to the current collation locale. See L<perllocale>. +Perl does B<not> guarantee that sort is stable. (In a I<stable> sort the +relative order is preserved for elements where the sort comparison used +returns that they are equal.) 5.7 happens to use a mergesort, which is +stable, but 5.6 and earlier used quicksort, which is not. However, do not +assume that future perls will continue to use a stable sort such as mergesort. + Examples: # sort lexically |