diff options
author | Nicholas Clark <nick@ccl4.org> | 2012-07-27 14:19:27 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2012-07-28 09:56:58 +0200 |
commit | 9a6b02e88d42f77b2a3c001bd483d8b69cbd3fb7 (patch) | |
tree | 80d346358eccfe043a25c5ca1f662e690057dd1d | |
parent | 697f9d37ed09fce0b3aa32beadd149fc18cca6e0 (diff) | |
download | perl-9a6b02e88d42f77b2a3c001bd483d8b69cbd3fb7.tar.gz |
Consolidate the code for returning false values from filetest operators.
Move the code that implements the non-stacking return processing from the
macro FT_RETURN_FALSE() into the static function S_ft_stacking_return_false().
Rename the function to S_ft_return_false() as it now handles all false cases.
-rw-r--r-- | pp_sys.c | 19 |
1 files changed, 7 insertions, 12 deletions
@@ -2909,7 +2909,7 @@ PP(pp_stat) */ static OP * -S_ft_stacking_return_false(pTHX_ SV *ret) { +S_ft_return_false(pTHX_ SV *ret) { OP *next = NORMAL; dSP; @@ -2917,21 +2917,16 @@ S_ft_stacking_return_false(pTHX_ SV *ret) { else SETs(ret); PUTBACK; - while (OP_IS_FILETEST(next->op_type) - && next->op_private & OPpFT_STACKED) - next = next->op_next; + if (PL_op->op_private & OPpFT_STACKING) { + while (OP_IS_FILETEST(next->op_type) + && next->op_private & OPpFT_STACKED) + next = next->op_next; + } return next; } #define FT_RETURN_FALSE(X) \ - STMT_START { \ - dSP; \ - if (PL_op->op_private & OPpFT_STACKING) \ - return S_ft_stacking_return_false(aTHX_ X); \ - PL_op->op_flags & OPf_REF ? XPUSHs(X) : SETs(X); \ - PUTBACK; \ - return NORMAL; \ - } STMT_END + return S_ft_return_false(aTHX_ X) #define FT_RETURN_TRUE(X) \ STMT_START { \ dSP; \ |