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)