about summary refs log tree commit homepage
path: root/lib/dtas/buffer.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-01-23 21:28:47 +0000
committerEric Wong <e@80x24.org>2022-01-23 21:29:22 +0000
commit27a288ff1033ae446e1d58d7c510bf9d1cf00961 (patch)
treec2382eab2223755096ab06e472a2ce73b16d10b8 /lib/dtas/buffer.rb
parentf9d9927e55d8c1132073af4f8b5dbbf3e04ea87d (diff)
downloaddtas-27a288ff1033ae446e1d58d7c510bf9d1cf00961.tar.gz
IO#close is idempotent since Ruby 2.3, so reduce our instruction
footprint to save some memory.
Diffstat (limited to 'lib/dtas/buffer.rb')
-rw-r--r--lib/dtas/buffer.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/dtas/buffer.rb b/lib/dtas/buffer.rb
index 54487c5..0688af9 100644
--- a/lib/dtas/buffer.rb
+++ b/lib/dtas/buffer.rb
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2020 all contributors <dtas-all@nongnu.org>
+# Copyright (C) all contributors <dtas-all@nongnu.org>
 # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
 # frozen_string_literal: true
 require 'io/wait'
@@ -45,7 +45,7 @@ class DTAS::Buffer # :nodoc:
 
   def __dst_error(dst, e)
     warn "dropping #{dst.inspect} due to error: #{e.message} (#{e.class})"
-    dst.close unless dst.closed?
+    dst.close
   end
 
   # This will modify targets