mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 13:04:13 +02:00
Skip calling f.read for overwrite: true
-only cases
We only need to set outpath for that case.
This commit is contained in:
parent
5ba9dcff16
commit
3262842e0a
1 changed files with 4 additions and 2 deletions
|
@ -30,8 +30,10 @@ class Output
|
|||
|
||||
if (@ifchange or overwrite or create_only) and (@vpath.open(@path, "rb") {|f|
|
||||
outpath = f.path
|
||||
original = f.read
|
||||
(@ifchange and original == data) or (create_only and !original.empty?)
|
||||
if @ifchange or create_only
|
||||
original = f.read
|
||||
(@ifchange and original == data) or (create_only and !original.empty?)
|
||||
end
|
||||
} rescue false)
|
||||
puts "#{outpath} #{unchanged}"
|
||||
written = false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue