From 27a288ff1033ae446e1d58d7c510bf9d1cf00961 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 23 Jan 2022 21:28:47 +0000 Subject: do not check IO#closed? before calling IO#close IO#close is idempotent since Ruby 2.3, so reduce our instruction footprint to save some memory. --- bin/dtas-readahead | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/dtas-readahead b/bin/dtas-readahead index 75bfbe8..6da5f88 100755 --- a/bin/dtas-readahead +++ b/bin/dtas-readahead @@ -205,7 +205,7 @@ begin timeout = 0 if timeout < 0 else work.each_value(&:close).clear - fp.close if fp && !fp.closed? + fp.close if fp fp = timeout = nil end r = w.to_io.wait_readable(timeout) -- cgit v1.2.3-24-ge0c7