mruby-dir/dir.rb: simplify loop delegation
MODIFY
mrbgems/mruby-dir/mrblib/dir.rb
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)

mruby-dir/dir.rb: simplify loop delegation