Commit f85fd191 authored by Marius Rackwitz's avatar Marius Rackwitz

[Analyzer] Reduce code duplication in #scope_suffix_for_distinctor

parent 7c68caba
......@@ -363,7 +363,6 @@ module Pod
result = targets_by_distinctors.map { |d, _| [d, platform_name_proc.call(d[1])] }
else
common_specs = all_spec_variants.reduce(all_spec_variants.first, &:&)
if all_spec_variants.uniq.count == all_spec_variants.count
result = targets_by_distinctors.map do |distinctor, _|
specs, = *distinctor
specs -= common_specs
......@@ -371,15 +370,12 @@ module Pod
# => Subspecs names without common subspecs
[distinctor, subspec_names.empty? ? nil : subspec_names.join('-')]
end
else
result = targets_by_distinctors.map do |distinctor, _|
specs, platform = *distinctor
specs -= common_specs
subspec_names = specs.map { |spec| spec.name.split('/')[1..-1].join('_') }
if all_spec_variants.count > all_spec_variants.uniq.count
result.map! do |distinctor, suffix|
_, platform = *distinctor
platform_name = platform_name_proc.call(platform)
name_parts = [platform_name] + subspec_names
# => Platform name (+ SDK version) + subspecs names without common subspecs
[distinctor, name_parts.join('-')]
[distinctor, [platform_name, suffix].compact.join('-')]
end
end
end
......
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