From: Eric Wong Date: Sun, 28 Feb 2016 11:28:32 +0000 (+0000) Subject: searchidx: use defined for checking EOF behavior X-Git-Tag: v1.0.0~689 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=8f090c1ff5e4eea068f20b30f1f79144aae936a3 searchidx: use defined for checking EOF behavior 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. --- diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index 67272997..1d0d926f 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);