From 75d90cc8e55ec662782526094b31ada1853a161b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Wed, 24 Aug 2022 10:57:35 +0200 Subject: [PATCH] [rubygems/rubygems] Use a single hash to keep track of prereleases https://github.com/rubygems/rubygems/commit/9d7bd177b0 --- lib/bundler/resolver.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb index f70e1a3395..161a3c0518 100644 --- a/lib/bundler/resolver.rb +++ b/lib/bundler/resolver.rb @@ -42,8 +42,7 @@ module Bundler remove_from_candidates(spec) end - @gem_version_promoter.prerelease_specified = @prerelease_specified = {} - requirements.each {|dep| @prerelease_specified[dep.name] ||= dep.prerelease? } + requirements.each {|dep| prerelease_specified[dep.name] ||= dep.prerelease? } verify_gemfile_dependencies_are_found!(requirements) result = @resolver.resolve(requirements). @@ -214,6 +213,10 @@ module Bundler @base.base_requirements end + def prerelease_specified + @gem_version_promoter.prerelease_specified + end + def remove_from_candidates(spec) @base.delete(spec) @@ -248,7 +251,7 @@ module Bundler all - 1_000_000 else search = search_for(dependency) - search = @prerelease_specified[dependency.name] ? search.count : search.count {|s| !s.version.prerelease? } + search = prerelease_specified[dependency.name] ? search.count : search.count {|s| !s.version.prerelease? } search - all end end