From cf6efd1bb77907825bb42ea305214ef415ae3382 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Thu, 25 Jul 2024 18:37:57 +0200 Subject: [PATCH] [rubygems/rubygems] Simplify logic to add current platform a bit https://github.com/rubygems/rubygems/commit/e102516e27 --- lib/bundler/definition.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 8014056c23..a96fd36b6a 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -671,19 +671,18 @@ module Bundler end def add_current_platform - @most_specific_non_local_locked_ruby_platform = find_most_specific_non_local_locked_ruby_platform + return if @platforms.include?(local_platform) + + @most_specific_non_local_locked_ruby_platform = find_most_specific_locked_ruby_platform return if @most_specific_non_local_locked_ruby_platform add_platform(local_platform) end - def find_most_specific_non_local_locked_ruby_platform + def find_most_specific_locked_ruby_platform return unless generic_local_platform_is_ruby? && current_platform_locked? - most_specific_locked_ruby_platform = most_specific_locked_platform - return unless most_specific_locked_ruby_platform != local_platform - - most_specific_locked_ruby_platform + most_specific_locked_platform end def change_reason