summaryrefslogtreecommitdiff
path: root/lib/rubygems/core_ext
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2020-05-19 14:00:00 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-06-05 07:32:42 +0900
commita18e81d797135de6e143a600e4f4d2b00ab23bf9 (patch)
treeaaf319c30c0b65fa0f2718b445cc7efe33736210 /lib/rubygems/core_ext
parent8c8364c84e53303baf3828fd5266cb5aec54c582 (diff)
[rubygems/rubygems] Fix performance regression in `require`
Our check for `-I` paths should not go through all activated gems. https://github.com/rubygems/rubygems/commit/00d98eb8a3
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3184
Diffstat (limited to 'lib/rubygems/core_ext')
-rw-r--r--lib/rubygems/core_ext/kernel_require.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb
index ed24111..7625ce1 100644
--- a/lib/rubygems/core_ext/kernel_require.rb
+++ b/lib/rubygems/core_ext/kernel_require.rb
@@ -47,7 +47,7 @@ module Kernel
load_path_insert_index = Gem.load_path_insert_index
break unless load_path_insert_index
- $LOAD_PATH[0...load_path_insert_index].each do |lp|
+ $LOAD_PATH[0...load_path_insert_index - Gem.activated_gem_paths].each do |lp|
safe_lp = lp.dup.tap(&Gem::UNTAINT)
begin
if File.symlink? safe_lp # for backward compatibility