ruby-changes:61558
From: David <ko1@a...>
Date: Fri, 5 Jun 2020 07:34:40 +0900 (JST)
Subject: [ruby-changes:61558] 07dca5c02c (master): [rubygems/rubygems] Extract a local outside the loop
https://git.ruby-lang.org/ruby.git/commit/?id=07dca5c02c From 07dca5c02c95322a39833705d3acd87b3adb00ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Tue, 19 May 2020 14:32:12 +0200 Subject: [rubygems/rubygems] Extract a local outside the loop https://github.com/rubygems/rubygems/commit/da1492e9d7 diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb index decf482..6a7faaf 100644 --- a/lib/rubygems/core_ext/kernel_require.rb +++ b/lib/rubygems/core_ext/kernel_require.rb @@ -43,8 +43,9 @@ module Kernel https://github.com/ruby/ruby/blob/trunk/lib/rubygems/core_ext/kernel_require.rb#L43 # https://github.com/rubygems/rubygems/pull/1868 resolved_path = begin rp = nil + load_path_check_index = Gem.load_path_insert_index - Gem.activated_gem_paths Gem.suffixes.each do |s| - $LOAD_PATH[0...Gem.load_path_insert_index - Gem.activated_gem_paths].each do |lp| + $LOAD_PATH[0...load_path_check_index].each do |lp| safe_lp = lp.dup.tap(&Gem::UNTAINT) begin if File.symlink? safe_lp # for backward compatibility -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/