From: Nicholas Clark Date: Wed, 1 Dec 2004 16:35:10 +0000 (+0000) Subject: Tidy up the reference name stringification to save getting the X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a5cb6b6262312bf62eeedd8696aa97c4d54cbcd7;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/sv.c b/sv.c index 43620e9..82b844a 100644 --- a/sv.c +++ b/sv.c @@ -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);