diff options
author | Sutou Kouhei <kou@clear-code.com> | 2020-01-16 06:57:12 +0900 |
---|---|---|
committer | Sutou Kouhei <kou@clear-code.com> | 2020-01-16 06:57:12 +0900 |
commit | e96b6b36146c3fab3a956dddb79c79822ebbb5ab (patch) | |
tree | 973227e62ca3adac145a7d6d8478e274aaece987 /lib | |
parent | 7466d82cae0c302d919a81304088bb399edf2409 (diff) | |
download | bundler-e96b6b36146c3fab3a956dddb79c79822ebbb5ab.tar.gz |
Remove needless if
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/resolver.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb index bcde144f76..2374ed3e5a 100644 --- a/lib/bundler/resolver.rb +++ b/lib/bundler/resolver.rb @@ -148,21 +148,22 @@ module Bundler end selected_sgs = [] search.each do |sg| - spec = sg.spec_for(platform) - next if spec.nil? + next unless sg.for?(platform) # Add a spec group for "non platform specific spec" as the fallback # spec group. sg_ruby = sg.copy_for(Gem::Platform::RUBY) selected_sgs << sg_ruby if sg_ruby sg_all_platforms = nil - self.class.sort_platforms(@platforms).reverse_each do |other_platform| + all_platforms = @platforms + [platform] + sorted_all_platforms = self.class.sort_platforms(all_platforms) + sorted_all_platforms.reverse_each do |other_platform| if sg_all_platforms.nil? sg_all_platforms = sg.copy_for(other_platform) else sg_all_platforms.activate_platform!(other_platform) end end - selected_sgs << sg_all_platforms if sg_all_platforms + selected_sgs << sg_all_platforms end selected_sgs end |