In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/18dcbbd3ae4eee82dc79319c25678e0c7a1088ee?hp=1a9ff134512968f758f5c3d9cf66b0cb30be4b4e>

- Log -----------------------------------------------------------------
commit 18dcbbd3ae4eee82dc79319c25678e0c7a1088ee
Author: Karl Williamson <[email protected]>
Date:   Thu Jan 25 13:36:25 2018 -0700

    regcomp.c: Clarify comment

commit e5393ecf6e9201af0e65d171162cb1d44e4c5bb3
Author: Karl Williamson <[email protected]>
Date:   Thu Jan 25 13:20:24 2018 -0700

    regcomp.c: Use existing function to do task
    
    The function does it better than this code, which looked too deeply into
    the internals, and got it wrong sometimes, because it didn't look at the
    state of the inversion.  The consequences are not a bug, but potentially
    forgoing an optimization, or needlessly looking for an optimization that
    will turn out to not be there.

commit a1bb8e70b2a0f6d14bba079cc28aa6b47ba1200f
Author: Karl Williamson <[email protected]>
Date:   Tue Jan 23 13:38:04 2018 -0700

    regcomp.c: Fix typo in comment

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

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

diff --git a/regcomp.c b/regcomp.c
index d0952cb48f..198f291f06 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -17400,7 +17400,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, 
U32 depth,
                         goto join_posix;
                     }
 #endif
-                    /* (named_class - ANY_OF_ASCII) is 0 or 1. xor'ing with
+                    /* (named_class - ANYOF_ASCII) is 0 or 1. xor'ing with
                      * invert converts that to 1 or 0 */
                     op = ASCII + ((namedclass - ANYOF_ASCII) ^ invert);
                     break;
@@ -18100,8 +18100,6 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, 
U32 depth,
         invlist_iterfinish(cp_list);
 
         if (op == END) {
-            const UV cp_list_len = _invlist_len(cp_list);
-            const UV* cp_list_array = invlist_array(cp_list);
 
             /* Here, didn't find an optimization.  See if this matches any of
              * the POSIX classes.  First try ASCII */
@@ -18114,7 +18112,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, 
U32 depth,
                 op = NASCII;
                 *flagp |= HASWIDTH|SIMPLE;
             }
-            else if (cp_list_array[cp_list_len-1] >= 0x2029) {
+            else if (invlist_highest(cp_list) >= 0x2029) {
 
                 /* Then try the other POSIX classes.  The POSIXA ones are about
                  * the same speed as ANYOF ops, but the ones that have
@@ -20606,9 +20604,9 @@ S_put_charclass_bitmap_innards(pTHX_ SV *sv,
      *      was not resolved at the time of the regex compilation (under /u)
      *  'only_utf8_locale_invlist' is an inversion list of the code points that
      *      are valid only if the runtime locale is a UTF-8 one; NULL if none
-     *  'node' is the regex pattern node.  It is needed only when the above two
-     *      parameters are not null, and is passed so that this routine can
-     *      tease apart the various reasons for them.
+     *  'node' is the regex pattern ANYOF node.  It is needed only when the
+     *      above two parameters are not null, and is passed so that this
+     *      routine can tease apart the various reasons for them.
      *  'force_as_is_display' is TRUE if this routine should definitely NOT try
      *      to invert things to see if that leads to a cleaner display.  If
      *      FALSE, this routine is free to use its judgment about doing this.

-- 
Perl5 Master Repository

Reply via email to