From 9a6b02e88d42f77b2a3c001bd483d8b69cbd3fb7 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Fri, 27 Jul 2012 14:19:27 +0200 Subject: 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. --- pp_sys.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/pp_sys.c b/pp_sys.c index 891a76d43c..e7163acbfc 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -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; \ -- cgit v1.2.1