From: Nicholas Clark Date: Thu, 9 Feb 2006 12:37:13 +0000 (+0000) Subject: Avoid calling all the scanning code in gv_fetchpvn_flags when saving X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=49f27e4b1bbb7347a4b84270b376766d25eca6cf;p=p5sagit%2Fp5-mst-13.2.git Avoid calling all the scanning code in gv_fetchpvn_flags when saving $1 etc, as we can perfom a hash lookup on %:: directly. p4raw-id: //depot/perl@27134 --- diff --git a/regcomp.c b/regcomp.c index 8bcfb8f..5d9fb63 100644 --- a/regcomp.c +++ b/regcomp.c @@ -6225,11 +6225,15 @@ Perl_save_re_context(pTHX) if (rx) { U32 i; for (i = 1; i <= rx->nparens; i++) { + GV *gv; char digits[TYPE_CHARS(long)]; const STRLEN len = my_sprintf(digits, "%lu", (long)i); - GV * const mgv = gv_fetchpvn_flags(digits, len, 0, SVt_PV); - if (mgv) - save_scalar(mgv); + GV *const *const gvp + = (GV**)hv_fetch(PL_defstash, digits, len, 0); + + if (gvp && SvTYPE(gv = *gvp) == SVt_PVGV && GvSV(gv)) { + save_scalar(gv); + } } } }