Skip to content
Browse files

Stop calling "super" twice in Rails::Server#app

Cache the value of "super" in a variable and use it instead.
  • Loading branch information...
1 parent 6e07658 commit d25a82280f977664e3b3d49c13bb68502718f6e2 @carlosantoniodasilva carlosantoniodasilva committed Mar 12, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 railties/lib/rails/commands/server.rb
View
5 railties/lib/rails/commands/server.rb
@@ -43,7 +43,10 @@ def initialize(*)
end
def app
- @app ||= super.respond_to?(:to_app) ? super.to_app : super
+ @app ||= begin
+ app = super
+ app.respond_to?(:to_app) ? app.to_app : app
+ end
end
def opt_parser

0 comments on commit d25a822

Please sign in to comment.
Something went wrong with that request. Please try again.