This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
gv.c: Don’t repeat GvSVn
authorFather Chrysostomos <sprout@cpan.org>
Mon, 11 Jun 2012 03:12:33 +0000 (20:12 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 15 Jun 2012 19:28:14 +0000 (12:28 -0700)
GvSVn checks whether there is a scalar present and creates one if there
is not.  So doing GvSVn twice in a row results in a redundant check.

It has been this way since c69033f2.

gv.c

diff --git a/gv.c b/gv.c
index 8bf975e..6c1e73e 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -1977,7 +1977,7 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags,
 
        case '\014':    /* $^L */
            sv_setpvs(GvSVn(gv),"\f");
-           PL_formfeed = GvSVn(gv);
+           PL_formfeed = GvSV(gv);
            break;
        case ';':               /* $; */
            sv_setpvs(GvSVn(gv),"\034");