Merge pull request #49029 from technicalpickles/abstractcontroller_base-action_methods-performance

Improve performance of AbstractController::Base#action_methods
This commit is contained in:
Rafael Mendonça França 2023-08-24 11:41:04 -04:00 committed by GitHub
commit 4df85d7089
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -91,14 +91,11 @@ def internal_methods
def action_methods
@action_methods ||= begin
# All public instance methods of this class, including ancestors
methods = (public_instance_methods(true) -
# Except for public instance methods of Base and its ancestors
internal_methods +
# Be sure to include shadowed public instance methods of this class
public_instance_methods(false))
# except for public instance methods of Base and its ancestors.
methods = public_instance_methods(true) - internal_methods
# Be sure to include shadowed public instance methods of this class.
methods.concat(public_instance_methods(false))
methods.map!(&:to_s)
methods.to_set
end
end