diff options
author | Karl Williamson <khw@cpan.org> | 2020-10-04 22:15:17 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-10-12 09:45:47 -0600 |
commit | 2f9be6e9825f6c192746c53107bbffda7e74bbc5 (patch) | |
tree | bfd8b12010882b375f92c07483b6d966328de2f1 /regcomp.c | |
parent | 01f72ca30b1f3af6817d4c6c6157af7bd14e46a2 (diff) | |
download | perl-2f9be6e9825f6c192746c53107bbffda7e74bbc5.tar.gz |
regcomp.c: regpiece: swap order of conditionals
Its a bit more clearer to test the 0 case before the 1 case, and by
doing so it becomes visually easier to compare and contrast the the two
cases.
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -12769,12 +12769,7 @@ S_regpiece(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth) /* 'SIMPLE' operands don't require full generality */ if ((flags&SIMPLE)) { if (max == REG_INFTY) { - if (min == 1) { - reginsert(pRExC_state, PLUS, ret, depth+1); - MARK_NAUGHTY(3); - goto done_main_op; - } - else if (min == 0) { + if (min == 0) { if (UNLIKELY(RExC_pm_flags & PMf_WILDCARD)) { goto min0_maxINF_wildcard_forbidden; } @@ -12783,6 +12778,11 @@ S_regpiece(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth) MARK_NAUGHTY(4); goto done_main_op; } + else if (min == 1) { + reginsert(pRExC_state, PLUS, ret, depth+1); + MARK_NAUGHTY(3); + goto done_main_op; + } } /* Here, SIMPLE, but not the '*' and '+' special cases */ |