1
0
Fork 0
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:
Conrad Irwin 2012-06-28 01:28:11 -07:00
parent 959775daa0
commit 61c7227675

View file

@ -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 }