From c5e13bf5ce9484aa5cbdcc8102718ee15d41c091 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Tue, 19 Feb 2013 14:35:49 +0100 Subject: [PATCH] Eliminate 'swap' from struct regexp_internal. It's been unused since commit e9105d30edfbaa7f in July 2009. --- pod/perlreguts.pod | 10 ---------- regcomp.c | 4 ---- regexp.h | 1 - 3 files changed, 15 deletions(-) diff --git a/pod/perlreguts.pod b/pod/perlreguts.pod index 75dc6dd..fbcb149 100644 --- a/pod/perlreguts.pod +++ b/pod/perlreguts.pod @@ -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 - -C formerly was an extra set of startp/endp stored in a -C 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 holds a mapping of offset in the C diff --git a/regcomp.c b/regcomp.c index ad0eabf..9edd1a8 100644 --- 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(). diff --git a/regexp.h b/regexp.h index 9cdc009..6f79be7 100644 --- 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. */ \ -- 2.7.4