From 21760a43c3b650e2af09c183e457e38ad4bf05c0 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 18 Oct 2014 10:32:52 +0000 Subject: 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. --- lib/dtas/player/client_handler.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/dtas/player/client_handler.rb') 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 } -- cgit v1.2.3-24-ge0c7