This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
op.c: ck_rvconst: Inline the noexpand var
authorFather Chrysostomos <sprout@cpan.org>
Wed, 10 Sep 2014 21:23:53 +0000 (14:23 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 15 Sep 2014 13:19:33 +0000 (06:19 -0700)
It is only used once now, and its name is about to become confusing,
as GV_NOEXPAND will be used for all CVs.

op.c

diff --git a/op.c b/op.c
index 78407f3..f4c73e6 100644 (file)
--- a/op.c
+++ b/op.c
@@ -8985,10 +8985,6 @@ Perl_ck_rvconst(pTHX_ OP *o)
 
     if (kid->op_type == OP_CONST) {
        int iscv;
-       const int noexpand = o->op_type == OP_RV2CV
-                         && o->op_private & OPpMAY_RETURN_CONSTANT
-                               ? GV_NOEXPAND
-                               : 0;
        GV *gv;
        SV * const kidsv = kid->op_sv;
 
@@ -9028,8 +9024,9 @@ Perl_ck_rvconst(pTHX_ OP *o)
         */
        iscv = (o->op_type == OP_RV2CV) * 2;
        gv = gv_fetchsv(kidsv,
-               noexpand
-                   ? noexpand
+               o->op_type == OP_RV2CV
+                       && o->op_private & OPpMAY_RETURN_CONSTANT
+                   ? GV_NOEXPAND
                    : iscv | !(kid->op_private & OPpCONST_ENTERED),
                iscv
                    ? SVt_PVCV