2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

Replace certain uses of 'gsub' with 'tr' or 'chomp' for a speed

improvement
This commit is contained in:
James Cook 2016-06-10 21:37:33 -05:00
parent d1c5949922
commit c0e25b5a9a
9 changed files with 15 additions and 16 deletions

View file

@ -20,9 +20,9 @@ module Slug
private
def self.ascii_generator(string)
string.gsub("'", "")
string.tr("'", "")
.parameterize
.gsub("_", "-")
.tr("_", "-")
end
def self.encoded_generator(string)