diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-01-01 13:06:27 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-01-01 13:07:30 -0800 |
commit | 8756617677dbda9a9ac19ac3155ca3bbabbf75a8 (patch) | |
tree | 278710b46c7769f71bb732a6ad4db5f158658453 /op.c | |
parent | 62f789982833b2c6a9005f78da558557992fcf8f (diff) | |
download | perl-8756617677dbda9a9ac19ac3155ca3bbabbf75a8.tar.gz |
Simplify gv:S_maybe_add_coresub
It was working around the fact that newATTRSUB expects to be able to
look up the GV by name.
And for speed, it was going through hoops to try to avoid creating
extra SVs holding the name unnecessarily.
By tweaking newATTRSUB to accept a GV instead of a name, we can sim-
plify not only S_maybe_add_coresub but all its callers, too.
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -6469,7 +6469,9 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) ps = NULL; if (name) { - gv = gv_fetchsv(cSVOPo->op_sv, gv_fetch_flags, SVt_PVCV); + gv = isGV(cSVOPo->op_sv) + ? (GV *)cSVOPo->op_sv + : gv_fetchsv(cSVOPo->op_sv, gv_fetch_flags, SVt_PVCV); has_name = TRUE; } else if (PERLDB_NAMEANON && CopLINE(PL_curcop)) { SV * const sv = sv_newmortal(); |