From f48098bd80cb93fcc670f2d0a016a64171dfad65 Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Sun, 17 Jan 2016 15:26:31 +0100 Subject: Spare to_sym call in `==`. The @symbol has already been converted to a symbol in initialize, so no need to call to_sym when comparing it. Ditch early return for a simple unless statement. --- actionview/lib/action_view/template/types.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'actionview/lib/action_view') diff --git a/actionview/lib/action_view/template/types.rb b/actionview/lib/action_view/template/types.rb index bc805de348..2bd8bcee02 100644 --- a/actionview/lib/action_view/template/types.rb +++ b/actionview/lib/action_view/template/types.rb @@ -36,8 +36,7 @@ module ActionView end def ==(type) - return false if type.blank? - symbol.to_sym == type.to_sym + @symbol == type.to_sym unless type.blank? end end -- cgit v1.2.3