regex: Splice out no longer used array element
authorKarl Williamson <public@khwilliamson.com>
Sat, 13 Oct 2012 15:07:05 +0000 (09:07 -0600)
committerKarl Williamson <public@khwilliamson.com>
Sun, 14 Oct 2012 15:03:37 +0000 (09:03 -0600)
A recent commit removed all uses of an array element in the middle of an
array.  This moves up the elements that followed it.

regcomp.c
regexec.c

index 75736c6..bad6b42 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -13138,10 +13138,9 @@ parseit:
         * av[1] if NULL, is a placeholder to later contain the swash computed
         *       from av[0].  But if no further computation need be done, the
         *       swash is stored there now.
-         * av[2] is always NULL
-        * av[3] stores the cp_list inversion list for use in addition or
+        * av[2] stores the cp_list inversion list for use in addition or
         *       instead of av[0]; used only if av[1] is NULL
-        * av[4] is set if any component of the class is from a user-defined
+        * av[3] is set if any component of the class is from a user-defined
         *       property; used only if av[1] is NULL */
        AV * const av = newAV();
        SV *rv;
@@ -13156,12 +13155,11 @@ parseit:
        else {
            av_store(av, 1, NULL);
            if (cp_list) {
-               av_store(av, 3, cp_list);
-               av_store(av, 4, newSVuv(has_user_defined_property));
+               av_store(av, 2, cp_list);
+               av_store(av, 3, newSVuv(has_user_defined_property));
            }
        }
 
-            av_store(av, 2, NULL);
        rv = newRV_noinc(MUTABLE_SV(av));
        n = add_data(pRExC_state, 1, "s");
        RExC_rxi->data->data[n] = (void*)rv;
index 5adb305..5985491 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -7076,12 +7076,12 @@ S_core_regclass_swash(pTHX_ const regexp *prog, register const regnode* node, bo
        
            si = *ary;  /* ary[0] = the string to initialize the swash with */
 
-           /* Elements 3 and 4 are either both present or both absent. [3] is
-            * any inversion list generated at compile time; [4] indicates if
+           /* Elements 2 and 3 are either both present or both absent. [2] is
+            * any inversion list generated at compile time; [3] indicates if
             * that inversion list has any user-defined properties in it. */
-           if (av_len(av) >= 3) {
-               invlist = ary[3];
-               if (SvUV(ary[4])) {
+           if (av_len(av) >= 2) {
+               invlist = ary[2];
+               if (SvUV(ary[3])) {
                     swash_init_flags |= _CORE_SWASH_INIT_USER_DEFINED_PROPERTY;
                 }
            }