]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/ProcessPipe.pm
reduce calls to close unless error checks are needed
[public-inbox.git] / lib / PublicInbox / ProcessPipe.pm
index eade524caada14ae99d4815822ec9738bef1f7ce..e088c1053f0b08877a277f281f3192925bac791d 100644 (file)
@@ -15,13 +15,12 @@ sub READ { sysread($_[0]->{fh}, $_[1], $_[2], $_[3] || 0) }
 
 sub READLINE { readline($_[0]->{fh}) }
 
-sub CLOSE { close($_[0]->{fh}) }
+sub CLOSE { delete($_[0]->{fh}) }
 
 sub FILENO { fileno($_[0]->{fh}) }
 
 sub DESTROY {
-       my $fh = delete($_[0]->{fh});
-       close $fh if $fh;
+       delete($_[0]->{fh});
        waitpid($_[0]->{pid}, 0);
 }