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/Config.pm | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/PublicInbox/Config.pm') diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm index 844f666e..b5116388 100644 --- a/lib/PublicInbox/Config.pm +++ b/lib/PublicInbox/Config.pm @@ -101,7 +101,6 @@ sub try_cat { if (open(my $fh, '<', $path)) { local $/; $rv = <$fh>; - close $fh; } $rv; } -- cgit v1.2.3-24-ge0c7