From 2ac2023fa416e31189708c355db8728abbd9ef2c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 28 Feb 2016 11:28:33 +0000 Subject: reduce calls to close unless error checks are needed We can rely on timely auto-destruction based on reference counting; reducing the chance of redundant close(2) calls which may hit the wront FD. We do care about certain close calls (e.g. writing to a buffered IO handle) if we require error-checking for write-integrity. In other cases, let things go out-of-scope so it can be freed automatically after use. --- lib/PublicInbox/Feed.pm | 2 -- 1 file changed, 2 deletions(-) (limited to 'lib/PublicInbox/Feed.pm') diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index a5828a8e..54cbf23c 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -255,7 +255,6 @@ sub each_recent_blob { } } - close $log; # we may EPIPE here # for pagination ($first_commit, $last_commit); } @@ -269,7 +268,6 @@ sub get_feedopts { my %rv; if (open my $fh, '<', "$ctx->{git_dir}/description") { chomp($rv{description} = <$fh>); - close $fh; } else { $rv{description} = '($GIT_DIR/description missing)'; } -- cgit v1.2.3-24-ge0c7