From: Father Chrysostomos Date: Sat, 7 Sep 2013 20:34:24 +0000 (-0700) Subject: regcomp.c:current_re_engine: Avoid %^H lookup when possible X-Git-Tag: v5.19.4~238 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/a046df752d35f41083b1946a2f0e23d234df233a?hp=6ddcf93bfb9c9445330f10bca453857b0fc69911 regcomp.c:current_re_engine: Avoid %^H lookup when possible Modification of %^H sets a flag in PL_hints, so we can check that flag to avoid the slight overhead of has lookup if %^H has not been used. --- diff --git a/regcomp.c b/regcomp.c index e0787e1..931f8fb 100644 --- a/regcomp.c +++ b/regcomp.c @@ -4881,7 +4881,7 @@ Perl_current_re_engine(pTHX) HV * const table = GvHV(PL_hintgv); SV **ptr; - if (!table) + if (!table || !(PL_hints & HINT_LOCALIZE_HH)) return &PL_core_reg_engine; ptr = hv_fetchs(table, "regcomp", FALSE); if ( !(ptr && SvIOK(*ptr) && SvIV(*ptr)))