From: Eric Wong Date: Fri, 15 Nov 2024 02:59:31 +0000 (+0000) Subject: view: reduce ops for encasement X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2df76ea74d919a6655914660aff7f13a43497414;p=thirdparty%2Fpublic-inbox.git view: reduce ops for encasement We can rely on print to concatenate its args and reduce the amount of needless copies and string ops before the print. --- diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 7ca85a859..ad2592530 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