From 90c94eb809e27525ede5f7656ca0b5e2e119b75b Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Wed, 5 Jul 2017 17:09:12 +0100 Subject: [PATCH] rationalise SvTRUE() macro variants define the plain, _nomg and _NN variants in terms of each other, e.g. #define SvTRUE(sv) (LIKELY(sv) && SvTRUE_NN(sv)) rather than duplicating common code text. There should be no functional changes, and the macros should (in theory) continue to expand to the same text. --- sv.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sv.h b/sv.h index b468ad0..f5cc185 100644 --- a/sv.h +++ b/sv.h @@ -1762,10 +1762,11 @@ Like C, but doesn't do magic on C. #define SvPVutf8x_force(sv, lp) sv_pvutf8n_force(sv, &lp) #define SvPVbytex_force(sv, lp) sv_pvbyten_force(sv, &lp) -#define SvTRUE(sv) (LIKELY(sv) && (UNLIKELY(SvGMAGICAL(sv)) ? sv_2bool(sv) : SvTRUE_common(sv, sv_2bool_nomg(sv)))) -#define SvTRUE_nomg(sv) (LIKELY(sv) && ( SvTRUE_common(sv, sv_2bool_nomg(sv)))) -#define SvTRUE_NN(sv) (UNLIKELY(SvGMAGICAL(sv)) ? sv_2bool(sv) : SvTRUE_common(sv, sv_2bool_nomg(sv))) -#define SvTRUE_nomg_NN(sv) ( SvTRUE_common(sv, sv_2bool_nomg(sv))) +#define SvTRUE(sv) (LIKELY(sv) && SvTRUE_NN(sv)) +#define SvTRUE_nomg(sv) (LIKELY(sv) && SvTRUE_nomg_NN(sv)) +#define SvTRUE_NN(sv) (UNLIKELY(SvGMAGICAL(sv)) ? sv_2bool(sv) : SvTRUE_nomg_NN(sv)) +#define SvTRUE_nomg_NN(sv) (SvTRUE_common(sv, sv_2bool_nomg(sv))) + #define SvTRUE_common(sv,fallback) ( \ !SvOK(sv) \ ? 0 \ -- 1.8.3.1