mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/fileutils] Reduce iteration through list for :mkdir_p
By calling the instruction to `list.map` within `list.each` itself. https://github.com/ruby/fileutils/commit/e690eec937
This commit is contained in:
parent
026ba68c10
commit
3dd9e12b51
1 changed files with 3 additions and 1 deletions
|
@ -208,7 +208,9 @@ module FileUtils
|
|||
fu_output_message "mkdir -p #{mode ? ('-m %03o ' % mode) : ''}#{list.join ' '}" if verbose
|
||||
return *list if noop
|
||||
|
||||
list.map {|path| remove_trailing_slash(path)}.each do |path|
|
||||
list.each do |item|
|
||||
path = remove_trailing_slash(item)
|
||||
|
||||
# optimize for the most common case
|
||||
begin
|
||||
fu_mkdir path, mode
|
||||
|
|
Loading…
Reference in a new issue