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.
---
 lib/PublicInbox/View.pm | 4 ++--
 1 file 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> (?:&#34; )?!!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);

Reply via email to