This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
we need duplicates counter only in list context
authorRuslan Zakirov <ruz@bestpractical.com>
Sat, 13 Oct 2012 17:27:12 +0000 (21:27 +0400)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 11 Dec 2012 16:59:41 +0000 (08:59 -0800)
pp_hot.c

index 47b3a7b..14b2878 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1092,12 +1092,11 @@ PP(pp_aassign)
                    if (*relem)
                        sv_setsv(tmpstr,*relem);        /* value */
                    relem++;
-                   if (gimme != G_VOID) {
+                   if (gimme == G_ARRAY) {
                        if (hv_exists_ent(hash, sv, 0))
                            /* key overwrites an existing entry */
                            duplicates += 2;
-                       else
-                       if (gimme == G_ARRAY) {
+                       else {
                            /* copy element back: possibly to an earlier
                             * stack location if we encountered dups earlier */
                            *topelem++ = sv;