From fd13b0dcd66223c4c2556f134a38b299c80ace69 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Tue, 21 Feb 2006 20:09:25 +0000 Subject: [PATCH] Can merge the two arms of Perl_magic_getglob to save space. p4raw-id: //depot/perl@27265 --- mg.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mg.c b/mg.c index 20344ad0cb..d9e6d765f3 100644 --- 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; } -- 2.34.1