This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_sort.c: call Perl_sortsv_flags directly
authorTomasz Konojacki <me@xenu.pl>
Mon, 2 Mar 2020 23:45:03 +0000 (00:45 +0100)
committerKarl Williamson <khw@cpan.org>
Mon, 9 Mar 2020 13:55:49 +0000 (07:55 -0600)
That pointer isn't needed.

pp_sort.c

index a65f28f..339122d 100644 (file)
--- a/pp_sort.c
+++ b/pp_sort.c
@@ -611,8 +611,6 @@ PP(pp_sort)
     const U8 priv = PL_op->op_private;
     const U8 flags = PL_op->op_flags;
     U32 sort_flags = 0;
-    void (*sortsvp)(pTHX_ SV **array, size_t nmemb, SVCOMPARE_t cmp, U32 flags)
-      = Perl_sortsv_flags;
     I32 all_SIVs = 1;
 
     if ((priv & OPpSORT_DESCEND) != 0)
@@ -812,7 +810,7 @@ PP(pp_sort)
             }
 
             start = p1 - max;
-            sortsvp(aTHX_ start, max,
+            Perl_sortsv_flags(aTHX_ start, max,
                     (is_xsub ? S_sortcv_xsub : hasargs ? S_sortcv_stacked : S_sortcv),
                     sort_flags);
 
@@ -838,7 +836,7 @@ PP(pp_sort)
         else {
             MEXTEND(SP, 20);    /* Can't afford stack realloc on signal. */
             start = ORIGMARK+1;
-            sortsvp(aTHX_ start, max,
+            Perl_sortsv_flags(aTHX_ start, max,
                     (priv & OPpSORT_NUMERIC)
                         ? ( ( ( priv & OPpSORT_INTEGER) || all_SIVs)
                             ? ( overloading ? S_amagic_i_ncmp : S_sv_i_ncmp)