about summary refs log tree commit homepage
path: root/lib/dtas
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2014-10-18 10:32:52 +0000
committerEric Wong <e@80x24.org>2014-10-21 01:47:37 +0000
commit21760a43c3b650e2af09c183e457e38ad4bf05c0 (patch)
tree781a14fc97b1b29f4d08bdf9240c4f87c60c2f3f /lib/dtas
parent3ec4a747cc12023293544fc0f8ee56ddc60ba86c (diff)
downloaddtas-21760a43c3b650e2af09c183e457e38ad4bf05c0.tar.gz
favor &:proc form instead of blocks in more places
This generates smaller bytecode and avoids unnecessary captures.
Perhaps the Ruby optimizer can be taught to handle this
automatically.
Diffstat (limited to 'lib/dtas')
-rw-r--r--lib/dtas/player/client_handler.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/dtas/player/client_handler.rb b/lib/dtas/player/client_handler.rb
index 28afc62..c9ae2e4 100644
--- a/lib/dtas/player/client_handler.rb
+++ b/lib/dtas/player/client_handler.rb
@@ -618,11 +618,11 @@ module DTAS::Player::ClientHandler # :nodoc:
   def __bp_prev_next(io, msg, cur, bp)
     case type = msg[1]
     when nil, "track"
-      bp.keep_if { |ci| ci.track? }
+      bp.keep_if(&:track?)
     when "pregap"
-      bp.keep_if { |ci| ci.pregap? }
+      bp.keep_if(&:pregap?)
     when "subindex" # any subindex
-      bp.keep_if { |ci| ci.subindex? }
+      bp.keep_if(&:subindex?)
     when /\A\d+\z/ # exact subindex match
       si = type.to_i
       bp.keep_if { |ci| ci.index == si }