shortcut all of Environment#process if @targets is empty

This commit is contained in:
Josh Holtrop 2014-04-15 16:18:33 -04:00
parent 8be1842cf8
commit ddf00d08a7

View File

@ -171,12 +171,11 @@ module Rscons
# When a block is passed to Environment.new, this method is automatically
# called after the block returns.
def process
unless @targets.empty?
clean_target_paths!
cache = Cache.instance
cache.clear_checksum_cache!
targets_processed = {}
unless @targets.empty?
begin
process_target = proc do |target|
targets_processed[target] ||= begin
@targets[target][:sources].each do |src|
@ -195,6 +194,7 @@ module Rscons
result
end
end
begin
@targets.each do |target, target_params|
process_target.call(target)
end