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,AWL,BAYES_00 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 E9AA420459 for ; Sun, 28 Feb 2016 11:28:36 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/3] searchidx: use defined for checking EOF behavior Date: Sun, 28 Feb 2016 11:28:32 +0000 Message-Id: <20160228112833.11319-3-e@80x24.org> In-Reply-To: <20160228112833.11319-1-e@80x24.org> References: <20160228112833.11319-1-e@80x24.org> List-Id: While empty or "0" should never appear, this allows the reviewer to think and know less about the context in which this check is done. --- lib/PublicInbox/SearchIdx.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index 6727299..1d0d926 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -337,7 +337,7 @@ sub rlog { --raw -r --no-abbrev/, $range); my $latest; my $bytes; - while (my $line = <$log>) { + while (defined(my $line = <$log>)) { if ($line =~ /$addmsg/o) { my $mime = do_cat_mail($git, $1, \$bytes) or next; $add_cb->($self, $git, $mime, $bytes); -- EW