Merge pull request #4260 from jamescook/james/replace-certain-gsub-with-tr

Replace certain uses of 'gsub' with 'tr' / 'chomp' for a speed improvement
This commit is contained in:
Guo Xiang Tan
2016-06-13 18:25:38 +08:00
committed by GitHub
9 changed files with 15 additions and 16 deletions

View File

@@ -203,7 +203,7 @@ SQL
end
def i18n_name
self.name.downcase.gsub(' ', '_')
self.name.downcase.tr(' ', '_')
end
end

View File

@@ -102,7 +102,7 @@ TopicStatusUpdate = Struct.new(:topic, :user) do
end
def locale_key
"topic_statuses.#{action_code.gsub('.', '_')}"
"topic_statuses.#{action_code.tr('.', '_')}"
end
def reopening_topic?