diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-11-06 20:44:01 +0300 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-11-06 20:44:01 +0300 |
commit | 2adfbf1c663e3cf1aa4ec82a90eed12e72c87309 (patch) | |
tree | 2f6270987f1b0f39e074db191ba1c1622663d34d /lib/gitlab/ci | |
parent | 4ba960c17d07e5863045c74fb554ebe71575d54d (diff) |
Avoid creating intersection if there's no array
Diffstat (limited to 'lib/gitlab/ci')
-rw-r--r-- | lib/gitlab/ci/config/normalizer.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/ci/config/normalizer.rb b/lib/gitlab/ci/config/normalizer.rb index ef263c4933c..969ae093e8b 100644 --- a/lib/gitlab/ci/config/normalizer.rb +++ b/lib/gitlab/ci/config/normalizer.rb @@ -42,8 +42,8 @@ module Gitlab def parallelize_dependencies(parallelized_config) parallelized_config.each_with_object({}) do |(job_name, config), hash| - intersection = config[:dependencies] & @parallelized_jobs.keys.map(&:to_s) - if intersection && intersection.any? + parallelized_job_names = @parallelized_jobs.keys.map(&:to_s) + if config[:dependencies] && (intersection = config[:dependencies] & parallelized_job_names).any? deps = intersection.map { |dep| @parallelized_jobs[dep.to_sym].map(&:first) }.flatten hash[job_name] = config.merge(dependencies: deps) else |