diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2016-01-17 16:10:43 +0100 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2016-01-17 16:31:13 +0100 |
commit | eb4ec6648d313586fd801582f20d845b6c2b7e20 (patch) | |
tree | a5be8fb9a268bde45559117236992ba546d7bd11 | |
parent | b1dcfa782e64859f9d03b6cf9474506ac5129337 (diff) | |
download | rails-eb4ec6648d313586fd801582f20d845b6c2b7e20.tar.gz rails-eb4ec6648d313586fd801582f20d845b6c2b7e20.tar.bz2 rails-eb4ec6648d313586fd801582f20d845b6c2b7e20.zip |
Don't bother looking up the types.
If they aren't symbols, then they aren't likely to be in the set anyway.
-rw-r--r-- | actionview/lib/action_view/template/types.rb | 6 |
1 files changed, 3 insertions, 3 deletions
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 |