Permalink
Browse files

String#freeze optimizations

  • Loading branch information...
schneems committed Jul 26, 2015
1 parent 57ba9cb commit 0d7a714dcae69668429c4b79e36f1b47d6c898e4
@@ -164,7 +164,7 @@ def deconstantize
#
# <%= 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
@@ -273,7 +273,7 @@ def normalize(string, form=nil)
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)

0 comments on commit 0d7a714

Please sign in to comment.