mruby-dir/dir.rb: simplify loop delegation

This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-12-21 14:42:50 +09:00
parent d0af9e9863
commit afcdf5e803
+1 -5
View File
@@ -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)