]> Sergey Matveev's repositories - public-inbox.git/commitdiff
searchidx: use defined for checking EOF behavior
authorEric Wong <e@80x24.org>
Sun, 28 Feb 2016 11:28:32 +0000 (11:28 +0000)
committerEric Wong <e@80x24.org>
Sun, 28 Feb 2016 11:30:31 +0000 (11:30 +0000)
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

index 67272997b22149faf3db8b9018a86ac8569f83ae..1d0d926f28164a29a904643bdc0cacdc7218fc22 100644 (file)
@@ -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);