summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-02-21 20:09:25 +0000
committerNicholas Clark <nick@ccl4.org>2006-02-21 20:09:25 +0000
commitfd13b0dcd66223c4c2556f134a38b299c80ace69 (patch)
tree9b50640a8dead1223c70c845f5ebb532c32240bb /mg.c
parent7a77f1af173fb7e6eb60fad332fc8a27d67c5ab6 (diff)
downloadperl-fd13b0dcd66223c4c2556f134a38b299c80ace69.tar.gz
Can merge the two arms of Perl_magic_getglob to save space.
p4raw-id: //depot/perl@27265
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c15
1 files 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;
}