aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2016-08-23 00:48:04 -0300
committerGitHub <noreply@github.com>2016-08-23 00:48:04 -0300
commitcea338d82e2eeebd355401883d785301c880d647 (patch)
treecc394633a5d3c9e9999503b6eb411ad22626d69e /actionview/lib/action_view
parent7f4b16ed83b878df6a68d471d2d5e7c719b40261 (diff)
parent735556d6ccbce382724b7c5dc63109c9b324d1ca (diff)
downloadrails-cea338d82e2eeebd355401883d785301c880d647.tar.gz
rails-cea338d82e2eeebd355401883d785301c880d647.tar.bz2
rails-cea338d82e2eeebd355401883d785301c880d647.zip
Merge pull request #26254 from badosu/improve-tag-option
Improve #tag_option performance
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r--actionview/lib/action_view/helpers/tag_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionview/lib/action_view/helpers/tag_helper.rb b/actionview/lib/action_view/helpers/tag_helper.rb
index 4950f272a4..24c6d03cd1 100644
--- a/actionview/lib/action_view/helpers/tag_helper.rb
+++ b/actionview/lib/action_view/helpers/tag_helper.rb
@@ -86,11 +86,11 @@ module ActionView
def tag_option(key, value, escape)
if value.is_a?(Array)
- value = escape ? safe_join(value, " ") : value.join(" ")
+ value = escape ? safe_join(value, " ".freeze) : value.join(" ".freeze)
else
value = escape ? ERB::Util.unwrapped_html_escape(value) : value.to_s
end
- %(#{key}="#{value.gsub(/"/, '&quot;'.freeze)}")
+ %(#{key}="#{value.gsub('"'.freeze, '&quot;'.freeze)}")
end
private