Eliminate 'swap' from struct regexp_internal.
authorNicholas Clark <nick@ccl4.org>
Tue, 19 Feb 2013 13:35:49 +0000 (14:35 +0100)
committerNicholas Clark <nick@ccl4.org>
Wed, 20 Feb 2013 08:48:00 +0000 (09:48 +0100)
It's been unused since commit e9105d30edfbaa7f in July 2009.

pod/perlreguts.pod
regcomp.c
regexp.h

index 75dc6dd..fbcb149 100644 (file)
@@ -796,7 +796,6 @@ regex engine. Since it is specific to perl it is only of curiosity
 value to other engine implementations.
 
  typedef struct regexp_internal {
-         regexp_paren_ofs *swap; /* Swap copy of *startp / *endp */
          U32 *offsets;           /* offset annotations 20001228 MJD
                                   * data about mapping the program to
                                   * the string*/
@@ -814,15 +813,6 @@ value to other engine implementations.
 
 =over 5
 
-=item C<swap>
-
-C<swap> formerly was an extra set of startp/endp stored in a
-C<regexp_paren_ofs> struct. This was used when the last successful match
-was from the same pattern as the current pattern, so that a partial
-match didn't overwrite the previous match's results, but it caused a
-problem with re-entrant code such as trying to build the UTF-8 swashes.
-Currently unused and left for backward compatibility with 5.10.0.
-
 =item C<offsets>
 
 Offsets holds a mapping of offset in the C<program>
index ad0eabf..9edd1a8 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -14986,10 +14986,6 @@ Perl_re_dup_guts(pTHX_ const REGEXP *sstr, REGEXP *dstr, CLONE_PARAMS *param)
     npar = r->nparens+1;
     Newx(ret->offs, npar, regexp_paren_pair);
     Copy(r->offs, ret->offs, npar, regexp_paren_pair);
-    if(ret->swap) {
-        /* no need to copy these */
-        Newx(ret->swap, npar, regexp_paren_pair);
-    }
 
     if (ret->substrs) {
        /* Do it this way to avoid reading from *r after the StructCopy().
index 9cdc009..6f79be7 100644 (file)
--- a/regexp.h
+++ b/regexp.h
@@ -119,7 +119,6 @@ struct reg_code_block {
        /* during matching */                                           \
        U32 lastparen;                  /* last open paren matched */   \
        U32 lastcloseparen;             /* last close paren matched */  \
-       regexp_paren_pair *swap;        /* Unused: 5.10.1 and later */  \
        /* Array of offsets for (@-) and (@+) */                        \
        regexp_paren_pair *offs;                                        \
        /* saved or original string so \digit works forever. */         \