This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
op.c:S_simplify_sort: remove redundant OPf_STACKED check
[perl5.git] / op.c
diff --git a/op.c b/op.c
index aaebdaa..2d6793e 100644 (file)
--- a/op.c
+++ b/op.c
@@ -9657,7 +9657,8 @@ Perl_ck_sort(pTHX_ OP *o)
 {
     dVAR;
     OP *firstkid;
-    HV * const hinthv = GvHV(PL_hintgv);
+    HV * const hinthv =
+       PL_hints & HINT_LOCALIZE_HH ? GvHV(PL_hintgv) : NULL;
 
     PERL_ARGS_ASSERT_CK_SORT;
 
@@ -9713,8 +9714,6 @@ S_simplify_sort(pTHX_ OP *o)
 
     PERL_ARGS_ASSERT_SIMPLIFY_SORT;
 
-    if (!(o->op_flags & OPf_STACKED))
-       return;
     GvMULTI_on(gv_fetchpvs("a", GV_ADD|GV_NOTQUAL, SVt_PV));
     GvMULTI_on(gv_fetchpvs("b", GV_ADD|GV_NOTQUAL, SVt_PV));
     kid = kUNOP->op_first;                             /* get past null */