From: Nicholas Clark Date: Mon, 5 Dec 2005 22:44:32 +0000 (+0000) Subject: As they are now the same, can fold the entire switch statement for X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8193e65bb36d71e3ea0cfdd7548f511b368fe2bd;p=p5sagit%2Fp5-mst-13.2.git As they are now the same, can fold the entire switch statement for reference type in sv_2pv_flags into a call to sv_reftype. p4raw-id: //depot/perl@26268 --- diff --git a/sv.c b/sv.c index 740f2de..4220ca4 100644 --- a/sv.c +++ b/sv.c @@ -2670,31 +2670,8 @@ Perl_sv_2pv_flags(pTHX_ register SV *sv, STRLEN *lp, I32 flags) return mg->mg_ptr; } + typestr = sv_reftype(sv, 0); - switch (SvTYPE(sv)) { - case SVt_NULL: - case SVt_IV: - case SVt_NV: - case SVt_RV: - case SVt_PV: - case SVt_PVIV: - case SVt_PVNV: - case SVt_PVMG: - case SVt_PVBM: typestr = SvVOK(sv) ? "VSTRING" - : SvROK(sv) ? "REF" : "SCALAR"; break; - case SVt_PVLV: typestr = SvROK(sv) ? "REF" - /* tied lvalues should appear to be - * scalars for backwards compatitbility */ - : (LvTYPE(sv) == 't' || LvTYPE(sv) == 'T') - ? "SCALAR" : "LVALUE"; break; - case SVt_PVAV: typestr = "ARRAY"; break; - case SVt_PVHV: typestr = "HASH"; break; - case SVt_PVCV: typestr = "CODE"; break; - case SVt_PVGV: typestr = "GLOB"; break; - case SVt_PVFM: typestr = "FORMAT"; break; - case SVt_PVIO: typestr = "IO"; break; - default: typestr = "UNKNOWN"; break; - } tsv = NEWSV(0,0); if (SvOBJECT(sv)) { const char * const name = HvNAME_get(SvSTASH(sv));