From f5aa58801122863961bd9a11e9d9c7b691ffca38 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 4 Apr 2020 08:03:19 +0000 Subject: [PATCH] view: inline flush_quote sub No point in having an extra sub for a short, commonly called function in the same file. --- lib/PublicInbox/View.pm | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 12ef6431..1e53d8dc 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -482,17 +482,6 @@ sub multipart_text_as_html { msg_iter($_[0], \&add_text_body, $_[1], 1); } -sub flush_quote { - my ($s, $l, $quot) = @_; - - my $rv = $l->to_html($$quot); - - # we use a here to allow users to specify their own - # color for quoted text - $$quot = undef; - $$s .= qq() . $rv . '' -} - sub attach_link ($$$$;$) { my ($ctx, $ct, $p, $fn, $err) = @_; my ($part, $depth, @idx) = @$p; @@ -587,14 +576,18 @@ sub add_text_body { # callback for msg_iter my $l = $ctx->{-linkify} //= PublicInbox::Linkify->new; foreach my $cur (@sections) { if ($cur =~ /\A>/) { - flush_quote($rv, $l, \$cur); + # we use a here to allow users to specify + # their own color for quoted text + $$rv .= qq(); + $$rv .= $l->to_html($cur); + $$rv .= ''; } elsif ($diff) { flush_diff($ctx, \$cur); } else { # regular lines, OK $$rv .= $l->to_html($cur); - $cur = undef; } + $cur = undef; } obfuscate_addrs($ibx, $$rv) if $ibx->{obfuscate}; -- 2.44.0