Commit d5919aeb authored by Matija Čupić's avatar Matija Čupić

Move extracting job names outside the loop

parent 126fbe58
...@@ -43,8 +43,8 @@ module Gitlab ...@@ -43,8 +43,8 @@ module Gitlab
end end
def parallelize_dependencies(parallelized_config) def parallelize_dependencies(parallelized_config)
parallelized_job_names = @parallelized_jobs.keys.map(&:to_s)
parallelized_config.each_with_object({}) do |(job_name, config), hash| parallelized_config.each_with_object({}) do |(job_name, config), hash|
parallelized_job_names = @parallelized_jobs.keys.map(&:to_s)
if config[:dependencies] && (intersection = config[:dependencies] & parallelized_job_names).any? if config[:dependencies] && (intersection = config[:dependencies] & parallelized_job_names).any?
deps = intersection.map { |dep| @parallelized_jobs[dep.to_sym].map(&:first) }.flatten deps = intersection.map { |dep| @parallelized_jobs[dep.to_sym].map(&:first) }.flatten
hash[job_name] = config.merge(dependencies: deps) hash[job_name] = config.merge(dependencies: deps)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment