Skip to content

Commit 4df85d7

Browse files
authored
Merge pull request rails#49029 from technicalpickles/abstractcontroller_base-action_methods-performance
Improve performance of AbstractController::Base#action_methods
2 parents 57b79cf + dc3da02 commit 4df85d7

File tree

1 file changed

+4
-7
lines changed
  • actionpack/lib/abstract_controller

1 file changed

+4
-7
lines changed

actionpack/lib/abstract_controller/base.rb

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,11 @@ def internal_methods
9191
def action_methods
9292
@action_methods ||= begin
9393
# All public instance methods of this class, including ancestors
94-
methods = (public_instance_methods(true) -
95-
# Except for public instance methods of Base and its ancestors
96-
internal_methods +
97-
# Be sure to include shadowed public instance methods of this class
98-
public_instance_methods(false))
99-
94+
# except for public instance methods of Base and its ancestors.
95+
methods = public_instance_methods(true) - internal_methods
96+
# Be sure to include shadowed public instance methods of this class.
97+
methods.concat(public_instance_methods(false))
10098
methods.map!(&:to_s)
101-
10299
methods.to_set
103100
end
104101
end

0 commit comments

Comments
 (0)