diff --git a/mrbgems/mruby-dir/mrblib/dir.rb b/mrbgems/mruby-dir/mrblib/dir.rb index 2ad4d96a8..6995775d4 100644 --- a/mrbgems/mruby-dir/mrblib/dir.rb +++ b/mrbgems/mruby-dir/mrblib/dir.rb @@ -21,11 +21,7 @@ class Dir end def foreach(path, &block) - if block - self.open(path).each {|f| block.call(f) } - else - self.open(path).each - end + self.open(path).each(&block) end def open(path, &block)