This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
op.c: Remove redundant op_lvalue call
authorFather Chrysostomos <sprout@cpan.org>
Sun, 1 Mar 2015 19:43:11 +0000 (11:43 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 1 Mar 2015 19:43:11 +0000 (11:43 -0800)
Refgen ops already call op_lvalue on their operands.  Calling it
beforehand causes it to be called twice, which is harmless, but
wasteful.

op.c

diff --git a/op.c b/op.c
index 45cde2b..9918a1e 100644 (file)
--- a/op.c
+++ b/op.c
@@ -3412,7 +3412,7 @@ S_apply_attrs_my(pTHX_ HV *stash, OP *target, OP *attrs, OP **imopsp)
                       newSVOP(OP_CONST, 0, stashsv),
                       op_prepend_elem(OP_LIST,
                                    newUNOP(OP_REFGEN, 0,
-                                           op_lvalue(arg, OP_REFGEN)),
+                                           arg),
                                    dup_attrlist(attrs)));
 
     /* Fake up a method call to import */