diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-12-27 08:08:49 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-12-27 08:08:49 +0000 |
commit | f5d04d3986b82dc1b3503dada145f6a0897ce69d (patch) | |
tree | 677d42a602730246eb95ae0838dc62fd64a85deb /lib/dtas | |
parent | f383a08ddbc45a8507eaf9f1654e25d6ea26e108 (diff) | |
download | dtas-f5d04d3986b82dc1b3503dada145f6a0897ce69d.tar.gz |
buffer/splice: favor &:method for blocks
This is slightly easier-to-read and avoids capturing local variables.
Diffstat (limited to 'lib/dtas')
-rw-r--r-- | lib/dtas/buffer/splice.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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] |