diff options
author | Eric Wong <e@80x24.org> | 2022-09-10 08:17:09 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2022-09-10 19:50:39 +0000 |
commit | 41c999da8f25bbe822366ffe4ac65c953ea40679 (patch) | |
tree | 2b3cda0a983d8140b486de440610c81ee6206c2f /lib/PublicInbox/View.pm | |
parent | e1190baa1463ee37e45b439a38f5e376ad39614b (diff) | |
download | public-inbox-41c999da8f25bbe822366ffe4ac65c953ea40679.tar.gz |
We can replace an expensive `s///' substitution with a simpler `chop'. Furthermore, we can delay the "</b>\n" replacement to ensure it's on the same line of Perl code as the `<b>' opening tag for readability.
Diffstat (limited to 'lib/PublicInbox/View.pm')
-rw-r--r-- | lib/PublicInbox/View.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 0fe645ca..3282d4f9 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -335,10 +335,10 @@ sub _th_index_lite { } my $s_s = nr_to_s($nr_s, 'sibling', 'siblings'); my $s_c = nr_to_s($nr_c, 'reply', 'replies'); - $attr =~ s!\n\z!</b>\n!s; + chop $attr; # remove "\n" $attr =~ s!<a\nhref.*</a> (?:" )?!!s; # no point in dup subject $attr =~ s!<a\nhref=[^>]+>([^<]+)</a>!$1!s; # no point linking to self - $rv .= "<b>@ $attr"; + $rv .= "<b>@ $attr</b>\n"; if ($nr_c) { my $cmid = $children->[0] ? $children->[0]->{mid} : undef; $rv .= $pad . _skel_hdr($mapping, $cmid); |