]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: html_footer: golf out a few lines
authorEric Wong <e@80x24.org>
Sat, 10 Sep 2022 08:17:12 +0000 (08:17 +0000)
committerEric Wong <e@80x24.org>
Sat, 10 Sep 2022 19:50:41 +0000 (19:50 +0000)
We can build `$u' in one line, and drop an unnecessary empty
line to reduce the amount of scrolling required to read this
sub.

lib/PublicInbox/View.pm

index 52d37a9ff690dbb32cc501ef0867137e0bc3b9fb..b27523b240e7e95fd26f3c35ad756dc0e567a738 100644 (file)
@@ -811,7 +811,6 @@ ${fallback}other threads:[<a
 href="$upfx?t=$t">~$t_fmt UTC</a>|<a
 href="$upfx">newest</a>]
 EOF
-
                thread_skel(\$skel, $ctx, $hdr);
                my ($next, $prev);
                my $parent = '       ';
@@ -821,12 +820,8 @@ EOF
                        $n = mid_href($n);
                        $next = "<a\nhref=\"$upfx$n/\"\nrel=next>next</a>";
                }
-               my $u;
                my $par = $ctx->{parent_msg};
-               if ($par) {
-                       $u = mid_href($par);
-                       $u = "$upfx$u/";
-               }
+               my $u = $par ? $upfx.mid_href($par).'/' : undef;
                if (my $p = $ctx->{prev_msg}) {
                        $prev = mid_href($p);
                        if ($p && $par && $p eq $par) {