aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorschneems <richard.schneeman@gmail.com>2015-07-26 14:31:18 -0500
committerschneems <richard.schneeman@gmail.com>2015-07-30 12:31:04 -0500
commit0d7a714dcae69668429c4b79e36f1b47d6c898e4 (patch)
tree896ff6a7b6857c6a8a69c978b420260c26c76a28 /activesupport
parent57ba9cbc6ccaa20a1ac3ca671d17040946839db3 (diff)
downloadrails-0d7a714dcae69668429c4b79e36f1b47d6c898e4.tar.gz
rails-0d7a714dcae69668429c4b79e36f1b47d6c898e4.tar.bz2
rails-0d7a714dcae69668429c4b79e36f1b47d6c898e4.zip
String#freeze optimizations
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/string/inflections.rb2
-rw-r--r--activesupport/lib/active_support/multibyte/unicode.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/inflections.rb b/activesupport/lib/active_support/core_ext/string/inflections.rb
index 97f9720b2b..0d5e02cd77 100644
--- a/activesupport/lib/active_support/core_ext/string/inflections.rb
+++ b/activesupport/lib/active_support/core_ext/string/inflections.rb
@@ -164,7 +164,7 @@ class String
#
# <%= link_to(@person.name, person_path) %>
# # => <a href="/person/1-donald-e-knuth">Donald E. Knuth</a>
- def parameterize(sep = '-')
+ def parameterize(sep = '-'.freeze)
ActiveSupport::Inflector.parameterize(self, sep)
end
diff --git a/activesupport/lib/active_support/multibyte/unicode.rb b/activesupport/lib/active_support/multibyte/unicode.rb
index f4de4a80d9..4de7fa4e4b 100644
--- a/activesupport/lib/active_support/multibyte/unicode.rb
+++ b/activesupport/lib/active_support/multibyte/unicode.rb
@@ -273,7 +273,7 @@ module ActiveSupport
compose(reorder_characters(decompose(:compatibility, codepoints)))
else
raise ArgumentError, "#{form} is not a valid normalization variant", caller
- end.pack('U*')
+ end.pack('U*'.freeze)
end
def downcase(string)