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
@ -30,8 +30,10 @@ class Output
|
|||||||
|
|
||||||
if (@ifchange or overwrite or create_only) and (@vpath.open(@path, "rb") {|f|
|
if (@ifchange or overwrite or create_only) and (@vpath.open(@path, "rb") {|f|
|
||||||
outpath = f.path
|
outpath = f.path
|
||||||
original = f.read
|
if @ifchange or create_only
|
||||||
(@ifchange and original == data) or (create_only and !original.empty?)
|
original = f.read
|
||||||
|
(@ifchange and original == data) or (create_only and !original.empty?)
|
||||||
|
end
|
||||||
} rescue false)
|
} rescue false)
|
||||||
puts "#{outpath} #{unchanged}"
|
puts "#{outpath} #{unchanged}"
|
||||||
written = false
|
written = false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user