[rubygems/rubygems] SpecSet#add_extra_platforms! doesn't need to return anything

https://github.com/rubygems/rubygems/commit/9fd92ade54
This commit is contained in:
David Rodríguez 2025-03-27 15:34:14 +01:00 committed by Hiroshi SHIBATA
parent 91df1795c5
commit f72d5effb7
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2
2 changed files with 6 additions and 5 deletions

View File

@ -760,7 +760,7 @@ module Bundler
end end
end end
@platforms = result.add_extra_platforms!(platforms) if should_add_extra_platforms? result.add_extra_platforms!(platforms) if should_add_extra_platforms?
SpecSet.new(result.for(dependencies, @platforms | [Gem::Platform::RUBY])) SpecSet.new(result.for(dependencies, @platforms | [Gem::Platform::RUBY]))
end end

View File

@ -48,7 +48,10 @@ module Bundler
end end
def add_extra_platforms!(platforms) def add_extra_platforms!(platforms)
return platforms.concat([Gem::Platform::RUBY]).uniq if @specs.empty? if @specs.empty?
platforms.concat([Gem::Platform::RUBY]).uniq
return
end
new_platforms = all_platforms.select do |platform| new_platforms = all_platforms.select do |platform|
next if platforms.include?(platform) next if platforms.include?(platform)
@ -56,14 +59,12 @@ module Bundler
complete_platform(platform) complete_platform(platform)
end end
return platforms if new_platforms.empty? return if new_platforms.empty?
platforms.concat(new_platforms) platforms.concat(new_platforms)
less_specific_platform = new_platforms.find {|platform| platform != Gem::Platform::RUBY && Bundler.local_platform === platform && platform === Bundler.local_platform } less_specific_platform = new_platforms.find {|platform| platform != Gem::Platform::RUBY && Bundler.local_platform === platform && platform === Bundler.local_platform }
platforms.delete(Bundler.local_platform) if less_specific_platform platforms.delete(Bundler.local_platform) if less_specific_platform
platforms
end end
def validate_deps(s) def validate_deps(s)