summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-09-27 09:18:42 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-09-27 09:18:42 +0000
commitd6a985f2bb09f0fd197b7c4af4b2d8913ce7f573 (patch)
tree77d1b2df1c397ef73feee6d251598da90eb8dd0b /op.c
parent3c09d6117750c436c0192c95bfc9527635ec04f2 (diff)
downloadperl-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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/op.c b/op.c
index fa6723f398..275e9fd78d 100644
--- a/op.c
+++ b/op.c
@@ -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)) {