Can merge the two arms of Perl_magic_getglob to save space.
authorNicholas Clark <nick@ccl4.org>
Tue, 21 Feb 2006 20:09:25 +0000 (20:09 +0000)
committerNicholas Clark <nick@ccl4.org>
Tue, 21 Feb 2006 20:09:25 +0000 (20:09 +0000)
p4raw-id: //depot/perl@27265

mg.c

diff --git a/mg.c b/mg.c
index 20344ad0cb1f2d235af30c1f4ade863f06ab5537..d9e6d765f312411c0b79d4533927591e8254e3ef 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -1839,14 +1839,15 @@ Perl_magic_setpos(pTHX_ SV *sv, MAGIC *mg)
 int
 Perl_magic_getglob(pTHX_ SV *sv, MAGIC *mg)
 {
+    const U32 wasfake = SvFLAGS(sv) & SVf_FAKE;
     PERL_UNUSED_ARG(mg);
-    if (SvFAKE(sv)) {                  /* FAKE globs can get coerced */
-       SvFAKE_off(sv);
-       gv_efullname3(sv,((GV*)sv), "*");
-       SvFAKE_on(sv);
-    }
-    else
-       gv_efullname3(sv,((GV*)sv), "*");       /* a gv value, be nice */
+
+    /* FAKE globs can get coerced, so need to turn this off temporarily if it
+       is on.  */
+    SvFAKE_off(sv);
+    gv_efullname3(sv,((GV*)sv), "*");
+    SvFLAGS(sv) |= wasfake;
+
     return 0;
 }