From eb4ec6648d313586fd801582f20d845b6c2b7e20 Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Sun, 17 Jan 2016 16:10:43 +0100 Subject: Don't bother looking up the types. If they aren't symbols, then they aren't likely to be in the set anyway. --- actionview/lib/action_view/template/types.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionview/lib/action_view/template/types.rb') diff --git a/actionview/lib/action_view/template/types.rb b/actionview/lib/action_view/template/types.rb index 4a64467ce9..650023f6c5 100644 --- a/actionview/lib/action_view/template/types.rb +++ b/actionview/lib/action_view/template/types.rb @@ -8,9 +8,9 @@ module ActionView SET = Set.new([ :html, :text, :js, :css, :xml, :json ]) def self.[](type) - return type if type.is_a?(self) - - if type.is_a?(Symbol) || SET.member?(type.to_s) + if type.is_a?(self) + type + else new(type) end end -- cgit v1.2.3