From f5d04d3986b82dc1b3503dada145f6a0897ce69d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 27 Dec 2013 08:08:49 +0000 Subject: buffer/splice: favor &:method for blocks This is slightly easier-to-read and avoids capturing local variables. --- lib/dtas/buffer/splice.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/dtas/buffer/splice.rb') diff --git a/lib/dtas/buffer/splice.rb b/lib/dtas/buffer/splice.rb index 55ce3d5..9093860 100644 --- a/lib/dtas/buffer/splice.rb +++ b/lib/dtas/buffer/splice.rb @@ -69,7 +69,7 @@ module DTAS::Buffer::Splice # :nodoc: end def broadcast_inf(targets) - if targets.none? { |sink| sink.nonblock? } + if targets.none?(&:nonblock?) # if all targets are blocking, don't start until they're all writable r = IO.select(nil, targets, nil, 0) or return targets blocked = targets - r[1] -- cgit v1.2.3-24-ge0c7