summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-02 09:24:17 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-02 09:24:17 +0000
commit0cdfe552874fb0fdffd17424aa25a0c7a49d88e1 (patch)
treebcee621164725279f97505bdb6726f35622c12ef /toke.c
parentf46d83d82e98cd6618202ff7fa6331027812cfc7 (diff)
downloadperl-0cdfe552874fb0fdffd17424aa25a0c7a49d88e1.tar.gz
Avoid duplicate calls to PAD_COMPNAME_OURSTASH, which is an expensive
macro. p4raw-id: //depot/perl@24672
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/toke.c b/toke.c
index cb17be98b8..8c13ba2977 100644
--- a/toke.c
+++ b/toke.c
@@ -5538,8 +5538,9 @@ S_pending_ident(pTHX)
/* might be an "our" variable" */
if (PAD_COMPNAME_FLAGS(tmp) & SVpad_OUR) {
/* build ops for a bareword */
- SV *sym = newSVpvn(HvNAME_get(PAD_COMPNAME_OURSTASH(tmp)),
- HvNAMELEN_get(PAD_COMPNAME_OURSTASH(tmp)));
+ HV *stash = PAD_COMPNAME_OURSTASH(tmp);
+ HEK *stashname = HvNAME_HEK(stash);
+ SV *sym = newSVpvn(HEK_KEY(stashname), HEK_LEN(stashname));
sv_catpvn(sym, "::", 2);
sv_catpv(sym, PL_tokenbuf+1);
yylval.opval = (OP*)newSVOP(OP_CONST, 0, sym);
@@ -9739,9 +9740,10 @@ S_scan_inputsymbol(pTHX_ char *start)
*/
if ((tmp = pad_findmy(d)) != NOT_IN_PAD) {
if (PAD_COMPNAME_FLAGS(tmp) & SVpad_OUR) {
- SV *sym = sv_2mortal(
- newSVpvn(HvNAME_get(PAD_COMPNAME_OURSTASH(tmp)),
- HvNAMELEN_get(PAD_COMPNAME_OURSTASH(tmp))));
+ HV *stash = PAD_COMPNAME_OURSTASH(tmp);
+ HEK *stashname = HvNAME_HEK(stash);
+ SV *sym = sv_2mortal(newSVpvn(HEK_KEY(stashname),
+ HEK_LEN(stashname)));
sv_catpvn(sym, "::", 2);
sv_catpv(sym, d+1);
d = SvPVX(sym);