]> Sergey Matveev's repositories - public-inbox.git/commitdiff
feed: avoid needless method dispatches on 404
authorEric Wong <e@80x24.org>
Mon, 20 Jun 2016 00:57:12 +0000 (00:57 +0000)
committerEric Wong <e@80x24.org>
Mon, 20 Jun 2016 00:57:34 +0000 (00:57 +0000)
We overuse streaming, here.  Allow Content-Length to be
calculated in this case.

lib/PublicInbox/Feed.pm

index 045e495fae9ed8acfe133743451f126014dd3323..d88421b0d98ef11e4052770e85c592e3e5aede02 100644 (file)
@@ -79,9 +79,8 @@ sub emit_atom {
 
 sub _no_thread {
        my ($cb) = @_;
-       my $fh = $cb->([404, ['Content-Type' => 'text/plain']]);
-       $fh->write("No feed found for thread\n");
-       $fh->close;
+       $cb->([404, ['Content-Type', 'text/plain'],
+               ["No feed found for thread\n"]]);
 }
 
 sub end_feed {