From a046df752d35f41083b1946a2f0e23d234df233a Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sat, 7 Sep 2013 13:34:24 -0700 Subject: [PATCH] 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. --- regcomp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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))) -- 1.8.3.1