diff options
author | Father Chrysostomos <sprout@cpan.org> | 2017-08-06 11:38:28 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2017-08-21 20:17:58 -0700 |
commit | afe59f35c2b4b2af5b2ebc50a90e2e559b1eaf87 (patch) | |
tree | bb0e04d2ccf3f7eb1f6ebd79a14838b15441d57c /pp_sort.c | |
parent | 9f9332db9d7efbba5be5556810f700da32ad6dee (diff) | |
download | perl-afe59f35c2b4b2af5b2ebc50a90e2e559b1eaf87.tar.gz |
Add SORTf_UNSTABLE flag
This will allow a future commit to make mergesort unstable when
the user specifies ‘no sort stable’, since it has been decided
that mergesort should remain stable by default.
This bit is not yet used, but is quite harmless.
Diffstat (limited to 'pp_sort.c')
-rw-r--r-- | pp_sort.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -46,6 +46,7 @@ #define SORTf_DESC 1 #define SORTf_STABLE 2 #define SORTf_QSORT 4 +#define SORTf_UNSTABLE 8 /* * The mergesort implementation is by Peter M. Mcilroy <pmcilroy@lucent.com>. @@ -1494,6 +1495,8 @@ PP(pp_sort) sort_flags |= SORTf_QSORT; if ((priv & OPpSORT_STABLE) != 0) sort_flags |= SORTf_STABLE; + if ((priv & OPpSORT_UNSTABLE) != 0) + sort_flags |= SORTf_UNSTABLE; if (gimme != G_ARRAY) { SP = MARK; |