summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2016-09-05 12:08:56 +0100
committerDavid Mitchell <davem@iabyn.com>2016-09-05 12:56:45 +0100
commitf6df9a2399f253aa91ac088837b425205fe9e6b7 (patch)
tree0df091524e23172575be85554b9977aca0852c73 /op.c
parentd1da3640384b1f8221ffa322a0ce6f7ff663a34c (diff)
downloadperl-f6df9a2399f253aa91ac088837b425205fe9e6b7.tar.gz
newMYSUB/Perl_newATTRSUB_x remove a goto
In both these functions there is code like: if (!block) goto attrs; ... attrs: Change them to if (block) { ... } attrs: Lets not use gotos if there's a better way. Will re-indent in next commit.
Diffstat (limited to 'op.c')
-rw-r--r--op.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/op.c b/op.c
index 70d0da019e..25cc39e217 100644
--- a/op.c
+++ b/op.c
@@ -8290,9 +8290,7 @@ Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
if ( ps_utf8 ) SvUTF8_on(MUTABLE_SV(cv));
}
- if (!block)
- goto attrs;
-
+ if (block) {
/* If we assign an optree to a PVCV, then we've defined a subroutine that
the debugger could be able to set a breakpoint in, so signal to
pp_entereval that it should not throw away any saved lines at scope
@@ -8317,6 +8315,7 @@ Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
/* now that optimizer has done its work, adjust pad values */
pad_tidy(CvCLONE(cv) ? padtidy_SUBCLONE : padtidy_SUB);
+ }
attrs:
if (attrs) {
@@ -8767,9 +8766,7 @@ Perl_newATTRSUB_x(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs,
if ( ps_utf8 ) SvUTF8_on(MUTABLE_SV(cv));
}
- if (!block)
- goto attrs;
-
+ if (block) {
/* If we assign an optree to a PVCV, then we've defined a subroutine that
the debugger could be able to set a breakpoint in, so signal to
pp_entereval that it should not throw away any saved lines at scope
@@ -8794,6 +8791,7 @@ Perl_newATTRSUB_x(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs,
/* now that optimizer has done its work, adjust pad values */
pad_tidy(CvCLONE(cv) ? padtidy_SUBCLONE : padtidy_SUB);
+ }
attrs:
if (attrs) {