From 8f090c1ff5e4eea068f20b30f1f79144aae936a3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 28 Feb 2016 11:28:32 +0000 Subject: 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. --- lib/PublicInbox/SearchIdx.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/SearchIdx.pm') 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); -- cgit v1.2.3-24-ge0c7