From 9b5d391f84ebc32466959f6f8f90891b3930c4b9 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Wed, 31 May 2017 13:44:20 -0600 Subject: [PATCH] regcomp.c: Don't set variable within an 'if' Sometimes it is convenient/and or necessary to do an assignment within a clause of an 'if', but it adds a little cognitive load. In this case, it's entirely unnecessary. This patch changes to do the assignment before the 'if'. --- regcomp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/regcomp.c b/regcomp.c index 199fde9..b0a279e 100644 --- a/regcomp.c +++ b/regcomp.c @@ -13446,10 +13446,10 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth) * this character again next time through, when it will be the * only thing in its new node */ - if ((next_is_quantifier = ( LIKELY(p < RExC_end) - && UNLIKELY(ISMULT2(p)))) - && LIKELY(len)) - { + next_is_quantifier = LIKELY(p < RExC_end) + && UNLIKELY(ISMULT2(p)); + + if (next_is_quantifier && LIKELY(len)) { p = oldp; goto loopdone; } -- 1.8.3.1