summaryrefslogtreecommitdiff
path: root/pp_sort.c
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2016-05-18 15:03:14 +1000
committerTony Cook <tony@develop-help.com>2017-09-11 10:59:42 +1000
commitf26b33bdaa1e41fbaf65c649a3208f081fa7571b (patch)
tree08ebd8b38bf725af3bd0a77465a1916229812aaf /pp_sort.c
parent3ff4feb5bd226622062600b4127bb8c276c9d5ec (diff)
downloadperl-f26b33bdaa1e41fbaf65c649a3208f081fa7571b.tar.gz
(perl #127663) create a separate random source for internal use
and use it to initialize hash randomization and to innoculate against quadratic behaviour in pp_sort
Diffstat (limited to 'pp_sort.c')
-rw-r--r--pp_sort.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp_sort.c b/pp_sort.c
index 5f39dba40e..604950910a 100644
--- a/pp_sort.c
+++ b/pp_sort.c
@@ -788,7 +788,7 @@ S_qsortsvu(pTHX_ SV ** array, size_t num_elts, SVCOMPARE_t compare)
size_t n;
SV ** const q = array;
for (n = num_elts; n > 1; ) {
- const size_t j = (size_t)(n-- * Drand01());
+ const size_t j = (size_t)(n-- * Perl_internal_drand48());
temp = q[j];
q[j] = q[n];
q[n] = temp;