Skip to content

Commit 42b5eca

Browse files
committed
S_unwind_loop(): remove opname param
This is only used for error messages, and can be derived from OP_NAME(PL_op); so for efficiency, don't pass it.
1 parent dc7f00c commit 42b5eca

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pp_ctl.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2473,18 +2473,18 @@ PP(pp_return)
24732473
}
24742474
}
24752475

2476-
/* find the enclosing loop or labelled loop and dounwind() back to it.
2477-
* opname is for errors */
2476+
/* find the enclosing loop or labelled loop and dounwind() back to it. */
24782477

24792478
PERL_CONTEXT *
2480-
S_unwind_loop(pTHX_ const char * const opname)
2479+
S_unwind_loop(pTHX)
24812480
{
24822481
I32 cxix;
24832482
if (PL_op->op_flags & OPf_SPECIAL) {
24842483
cxix = dopoptoloop(cxstack_ix);
24852484
if (cxix < 0)
24862485
/* diag_listed_as: Can't "last" outside a loop block */
2487-
Perl_croak(aTHX_ "Can't \"%s\" outside a loop block", opname);
2486+
Perl_croak(aTHX_ "Can't \"%s\" outside a loop block",
2487+
OP_NAME(PL_op));
24882488
}
24892489
else {
24902490
dSP;
@@ -2502,7 +2502,7 @@ S_unwind_loop(pTHX_ const char * const opname)
25022502
if (cxix < 0)
25032503
/* diag_listed_as: Label not found for "last %s" */
25042504
Perl_croak(aTHX_ "Label not found for \"%s %"SVf"\"",
2505-
opname,
2505+
OP_NAME(PL_op),
25062506
SVfARG(PL_op->op_flags & OPf_STACKED
25072507
&& !SvGMAGICAL(TOPp1s)
25082508
? TOPp1s
@@ -2521,7 +2521,7 @@ PP(pp_last)
25212521
PERL_CONTEXT *cx;
25222522
OP* nextop;
25232523

2524-
cx = S_unwind_loop(aTHX_ "last");
2524+
cx = S_unwind_loop(aTHX);
25252525

25262526
assert(CxTYPE_is_LOOP(cx));
25272527
PL_stack_sp = PL_stack_base
@@ -2546,7 +2546,7 @@ PP(pp_next)
25462546
{
25472547
PERL_CONTEXT *cx;
25482548

2549-
cx = S_unwind_loop(aTHX_ "next");
2549+
cx = S_unwind_loop(aTHX);
25502550

25512551
TOPBLOCK(cx);
25522552
PL_curcop = cx->blk_oldcop;
@@ -2556,7 +2556,7 @@ PP(pp_next)
25562556

25572557
PP(pp_redo)
25582558
{
2559-
PERL_CONTEXT *cx = S_unwind_loop(aTHX_ "redo");
2559+
PERL_CONTEXT *cx = S_unwind_loop(aTHX);
25602560
OP* redo_op = cx->blk_loop.my_op->op_redoop;
25612561

25622562
if (redo_op->op_type == OP_ENTER) {

0 commit comments

Comments
 (0)