Avoid getting the stash name twice (at least visually, if not also
Nicholas Clark [Tue, 7 Dec 2004 23:39:46 +0000 (23:39 +0000)]
in the generated code)

p4raw-id: //depot/perl@23626

sv.c

diff --git a/sv.c b/sv.c
index 82b844a..7687921 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -8404,10 +8404,8 @@ char *
 Perl_sv_reftype(pTHX_ SV *sv, int ob)
 {
     if (ob && SvOBJECT(sv)) {
-       if (HvNAME(SvSTASH(sv)))
-           return HvNAME(SvSTASH(sv));
-       else
-           return "__ANON__";
+       char *name = HvNAME(SvSTASH(sv));
+       return name ? name : "__ANON__";
     }
     else {
        switch (SvTYPE(sv)) {