mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Don't call .alias? in WrappedModule#source_location
Unfortunately, alias? requires loading the entire source code for each method, so this can get pretty slow for modules that include hundreds of methods.
This commit is contained in:
parent
959775daa0
commit
61c7227675
1 changed files with 1 additions and 7 deletions
|
@ -223,13 +223,7 @@ class Pry
|
|||
|
||||
ims = all_methods_for(wrapped)
|
||||
|
||||
ims.reject! do |v|
|
||||
begin
|
||||
v.alias? || v.source_location.nil?
|
||||
rescue Pry::RescuableException
|
||||
true
|
||||
end
|
||||
end
|
||||
ims.select!(&:source_location)
|
||||
|
||||
@all_source_locations_by_popularity = ims.group_by { |v| Array(v.source_location).first }.
|
||||
sort_by { |k, v| -v.size }
|
||||
|
|
Loading…
Reference in a new issue