From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id A3C851F4D3 for ; Fri, 15 Nov 2024 02:59:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1731639573; bh=DV0K+V8ohMMUXx+ktr0Vjp6qPWZzYyUtwyztG41VS9U=; h=From:To:Subject:Date:In-Reply-To:References:From; b=o3xATceztSyi6NDouDnox7vBhnqJXJ7puLrGrViySD1KmTQVyfhLEuvj2CFGl68nT AroK2TmzJkt8jksoOW8PaOTUDIxXa/6+6LfNK1+lwrCKdaMjZ/QG6tNI41HobWeAaA UdLDGB3Bvyue3xdci6fer4Zwdwz+KZZa4yIjSGOs= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 5/6] view: reduce ops for encasement Date: Fri, 15 Nov 2024 02:59:31 +0000 Message-ID: <20241115025932.1647240-6-e@80x24.org> In-Reply-To: <20241115025932.1647240-1-e@80x24.org> References: <20241115025932.1647240-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We can rely on print to concatenate its args and reduce the amount of needless copies and string ops before the print. --- lib/PublicInbox/View.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 7ca85a85..ad259253 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -272,13 +272,12 @@ sub emit_eml ($$) { my $root_anchor = $ctx->{root_anchor} || ''; my $irt; my $obfs_ibx = $ctx->{-obfs_ibx}; - $subj = '(no subject)' if $subj eq ''; - $subj = ''.ascii_html($subj).''; + $subj = $subj eq '' ? '(no subject)' : ascii_html($subj); obfuscate_addrs($obfs_ibx, $subj) if $obfs_ibx; $subj = "$subj" if $root_anchor eq $id_m; my $zfh = $ctx->{zfh} // die 'BUG: no {zfh}'; - print $zfh "* ', - $subj, "\n", _th_index_lite($mid_raw, \$irt, $id, $ctx); + print $zfh "* ', + $subj, "\n", _th_index_lite($mid_raw, \$irt, $id, $ctx); my @tocc; my $ds = delete $smsg->{ds}; # for v1 non-Xapian/SQLite users