In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/a4eb0505c203b947fe64e98ace1af076f4c12153?hp=98265db13ab995d94aae0c4dac07ab0b9b995e87>

- Log -----------------------------------------------------------------
commit a4eb0505c203b947fe64e98ace1af076f4c12153
Author: Karl Williamson <[email protected]>
Date:   Sat Feb 16 11:29:51 2019 -0700

    regcomp.c: Don't interate a loop needlessly
    
    While single stepping in gdb, I noticed that this loop kept executing,
    when it need not.

-----------------------------------------------------------------------

Summary of changes:
 regcomp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/regcomp.c b/regcomp.c
index fffacc63f7..5949b8809b 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -18057,9 +18057,10 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 
*flagp, U32 depth,
 
             invlist_iterinit(cp_list);
             for (i = 0; i <= MAX_FOLD_FROMS; i++) {
-                if (invlist_iternext(cp_list, &start[i], &end[i])) {
-                    partial_cp_count += end[i] - start[i] + 1;
+                if (! invlist_iternext(cp_list, &start[i], &end[i])) {
+                    break;
                 }
+                partial_cp_count += end[i] - start[i] + 1;
             }
 
             invlist_iterfinish(cp_list);

-- 
Perl5 Master Repository

Reply via email to