diff options
author | Nicholas Clark <nick@ccl4.org> | 2004-12-01 16:35:10 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2004-12-01 16:35:10 +0000 |
commit | a5cb6b6262312bf62eeedd8696aa97c4d54cbcd7 (patch) | |
tree | 47426d91f099f546f78de1f4b2c32e9cc0973846 /sv.c | |
parent | dbc1d98621f53e4a3938cf011ae90a189e72f69f (diff) | |
download | perl-a5cb6b6262312bf62eeedd8696aa97c4d54cbcd7.tar.gz |
Tidy up the reference name stringification to save getting the
hash name twice. Pleasant side effect is 44 byte smaller object
file. (A small win is still a win)
p4raw-id: //depot/perl@23587
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -3620,14 +3620,13 @@ Perl_sv_2pv_flags(pTHX_ register SV *sv, STRLEN *lp, I32 flags) default: s = "UNKNOWN"; break; } tsv = NEWSV(0,0); - if (SvOBJECT(sv)) - if (HvNAME(SvSTASH(sv))) - Perl_sv_setpvf(aTHX_ tsv, "%s=%s", HvNAME(SvSTASH(sv)), s); - else - Perl_sv_setpvf(aTHX_ tsv, "__ANON__=%s", s); + if (SvOBJECT(sv)) { + const char *name = HvNAME(SvSTASH(sv)); + Perl_sv_setpvf(aTHX_ tsv, "%s=%s(0x%"UVxf")", + name ? name : "__ANON__" , s, PTR2UV(sv)); + } else - sv_setpv(tsv, s); - Perl_sv_catpvf(aTHX_ tsv, "(0x%"UVxf")", PTR2UV(sv)); + Perl_sv_setpvf(aTHX_ tsv, "%s(0x%"UVxf")", s, PTR2UV(sv)); goto tokensaveref; } *lp = strlen(s); |