From 9b08afd2f4d501fb1710ba0ed4e19313093605c8 Mon Sep 17 00:00:00 2001 From: Milan Dobrota Date: Sun, 4 Sep 2011 10:44:08 -0500 Subject: if ... nil? is more expensive than unless --- actionpack/lib/action_controller/metal/redirecting.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller/metal') diff --git a/actionpack/lib/action_controller/metal/redirecting.rb b/actionpack/lib/action_controller/metal/redirecting.rb index 4f311a1cf5..f2dfb3833b 100644 --- a/actionpack/lib/action_controller/metal/redirecting.rb +++ b/actionpack/lib/action_controller/metal/redirecting.rb @@ -57,7 +57,7 @@ module ActionController # When using redirect_to :back, if there is no referrer, RedirectBackError will be raised. You may specify some fallback # behavior for this case by rescuing RedirectBackError. def redirect_to(options = {}, response_status = {}) #:doc: - raise ActionControllerError.new("Cannot redirect to nil!") if options.nil? + raise ActionControllerError.new("Cannot redirect to nil!") unless options raise AbstractController::DoubleRenderError if response_body self.status = _extract_redirect_to_status(options, response_status) -- cgit v1.2.3