From: Nicholas Clark Date: Tue, 21 Feb 2006 20:09:25 +0000 (+0000) Subject: Can merge the two arms of Perl_magic_getglob to save space. X-Git-Tag: accepted/trunk/20130322.191538~18448 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fd13b0dcd66223c4c2556f134a38b299c80ace69;p=platform%2Fupstream%2Fperl.git Can merge the two arms of Perl_magic_getglob to save space. p4raw-id: //depot/perl@27265 --- diff --git a/mg.c b/mg.c index 20344ad..d9e6d76 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; }