diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2020-05-19 14:32:12 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-06-05 07:32:42 +0900 |
commit | 07dca5c02c95322a39833705d3acd87b3adb00ac (patch) | |
tree | a3e0432917136b509e24c09dcb607192defa4215 /lib | |
parent | 5aa5aad48aa3effce60de3559d9bd107bfc9a91d (diff) |
[rubygems/rubygems] Extract a local outside the loop
https://github.com/rubygems/rubygems/commit/da1492e9d7
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3184
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rubygems/core_ext/kernel_require.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb index decf4829f1..6a7faaf2d1 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/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 |