diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-09-27 09:18:42 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-09-27 09:18:42 +0000 |
commit | d6a985f2bb09f0fd197b7c4af4b2d8913ce7f573 (patch) | |
tree | 77d1b2df1c397ef73feee6d251598da90eb8dd0b /op.c | |
parent | 3c09d6117750c436c0192c95bfc9527635ec04f2 (diff) | |
download | perl-d6a985f2bb09f0fd197b7c4af4b2d8913ce7f573.tar.gz |
Micro-optimisation: use PL_globalstash instead of looking up
CORE::GLOBAL::require by name
p4raw-id: //depot/perl@25615
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -5958,8 +5958,10 @@ Perl_ck_require(pTHX_ OP *o) if (!(o->op_flags & OPf_SPECIAL)) { /* Wasn't written as CORE::require */ /* handle override, if any */ gv = gv_fetchpv("require", FALSE, SVt_PVCV); - if (!(gv && GvCVu(gv) && GvIMPORTED_CV(gv))) - gv = gv_fetchpv("CORE::GLOBAL::require", FALSE, SVt_PVCV); + if (!(gv && GvCVu(gv) && GvIMPORTED_CV(gv))) { + GV **gvp = (GV**)hv_fetch(PL_globalstash, "require", 7, FALSE); + if (gvp) gv = *gvp; else gv = Nullgv; + } } if (gv && GvCVu(gv) && GvIMPORTED_CV(gv)) { |