From b6615179744d98e21b137e338ff96f4f21f3035a Mon Sep 17 00:00:00 2001 From: Rob Gleeson Date: Mon, 30 May 2011 19:09:52 +0100 Subject: [PATCH] Simplify Pry::CommandSet#each. --- lib/pry/command_set.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/pry/command_set.rb b/lib/pry/command_set.rb index 65101c5a..3b185382 100644 --- a/lib/pry/command_set.rb +++ b/lib/pry/command_set.rb @@ -123,13 +123,7 @@ class Pry end def each &block - if block_given? - @commands.each do |name, struct| - yield(name, struct) - end - else - @commands.to_enum - end + @commands.each(&block) end # Removes some commands from the set