diff options
author | David Mitchell <davem@iabyn.com> | 2015-06-19 09:45:54 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2015-06-19 09:45:54 +0100 |
commit | a05700a87a1c6e3a191a8fcb99082092e4c5c6eb (patch) | |
tree | 724ace37e61f3d9dbedb60c162de66466c933ac9 | |
parent | d40dc6b141019491ca18144b6a25c03e8882ffe8 (diff) | |
download | perl-a05700a87a1c6e3a191a8fcb99082092e4c5c6eb.tar.gz |
sinplify Perl_block_gimme()
The switch statement was fairly pointless, as it was just a bunch of
case G_VOID:
return G_VOID;
so replace the switch with a simple "croak if 0, otherwise return the
value".
-rw-r--r-- | pp_ctl.c | 17 |
1 files changed, 6 insertions, 11 deletions
@@ -1349,22 +1349,17 @@ I32 Perl_block_gimme(pTHX) { const I32 cxix = dopoptosub(cxstack_ix); + U8 gimme; if (cxix < 0) return G_VOID; - switch (cxstack[cxix].blk_gimme) { - case G_VOID: - return G_VOID; - case G_SCALAR: - return G_SCALAR; - case G_ARRAY: - return G_ARRAY; - default: - Perl_croak(aTHX_ "panic: bad gimme: %d\n", cxstack[cxix].blk_gimme); - } - NOT_REACHED; /* NOTREACHED */ + gimme = (cxstack[cxix].blk_gimme & G_WANT); + if (!gimme) + Perl_croak(aTHX_ "panic: bad gimme: %d\n", gimme); + return gimme; } + I32 Perl_is_lvalue_sub(pTHX) { |