]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: attach_link uses string concatentation
authorEric Wong <e@80x24.org>
Wed, 17 Aug 2016 23:07:43 +0000 (23:07 +0000)
committerEric Wong <e@80x24.org>
Thu, 18 Aug 2016 01:04:44 +0000 (01:04 +0000)
There is no point in using an array to join on an
empty string (my original intention was probably to
join on "\n").

This is only preparation for the next change to show
a warning to in the attachment link.

lib/PublicInbox/View.pm

index 6f79f601d777d2c9e9f895acc48b6c365f47d904..305722168a9ad2d132733db92cdc4bdc944e04f0 100644 (file)
@@ -427,10 +427,10 @@ sub attach_link ($$$$) {
        } else {
                $sfn = 'a.bin';
        }
-       my @ret = qq($nl<a\nhref="$upfx$idx-$sfn">[-- Attachment #$idx: );
+       my $ret = qq($nl<a\nhref="$upfx$idx-$sfn">[-- Attachment #$idx: );
        my $ts = "Type: $ct, Size: $size bytes";
-       push(@ret, ($desc eq '') ? "$ts --]" : "$desc --]\n[-- $ts --]");
-       join('', @ret, "</a>\n");
+       $ret .= ($desc eq '') ? "$ts --]" : "$desc --]\n[-- $ts --]";
+       $ret .= "</a>\n";
 }
 
 sub add_text_body {