From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 5BC721FD20; Thu, 27 Aug 2015 04:34:05 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Cc: Eric Wong Subject: [PATCH 1/5] www: minor cleanups to shorten code Date: Thu, 27 Aug 2015 04:33:58 +0000 Message-Id: <1440650042-26176-2-git-send-email-e@80x24.org> In-Reply-To: <1440650042-26176-1-git-send-email-e@80x24.org> References: <1440650042-26176-1-git-send-email-e@80x24.org> List-Id: Less scrolling is more efficient. --- lib/PublicInbox/WWW.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm index d1ee2ff..527d213 100644 --- a/lib/PublicInbox/WWW.pm +++ b/lib/PublicInbox/WWW.pm @@ -138,7 +138,6 @@ sub mid2blob { my $path = PublicInbox::MID::mid2path($ctx->{mid}); my @cmd = ('git', "--git-dir=$ctx->{git_dir}", qw(cat-file blob), "HEAD:$path"); - my $cmd = join(' ', @cmd); my $pid = open my $fh, '-|'; defined $pid or die "fork failed: $!\n"; if ($pid == 0) { @@ -162,8 +161,7 @@ sub get_mid_txt { # /$LISTNAME/m/$MESSAGE_ID.html -> HTML content (short quotes) sub get_mid_html { my ($ctx) = @_; - my $x = mid2blob($ctx); - return r404() unless $x; + my $x = mid2blob($ctx) or return r404(); require PublicInbox::View; my $pfx = msg_pfx($ctx); @@ -178,8 +176,8 @@ sub get_mid_html { # /$LISTNAME/f/$MESSAGE_ID.html -> HTML content (fullquotes) sub get_full_html { my ($ctx) = @_; - my $x = mid2blob($ctx); - return r404() unless $x; + my $x = mid2blob($ctx) or return r404(); + require PublicInbox::View; my $foot = footer($ctx); require Email::MIME; -- EW