From b7f15fbadcaed2b708aa156048ab5c37cb7b01ff Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sun, 12 Aug 2018 23:40:44 +0000 Subject: Replace String#gsub with faster String#tr (#29363). Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@17469 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/sys_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers') diff --git a/app/controllers/sys_controller.rb b/app/controllers/sys_controller.rb index bd8238a6a..35886fc4e 100644 --- a/app/controllers/sys_controller.rb +++ b/app/controllers/sys_controller.rb @@ -38,7 +38,7 @@ class SysController < ActionController::Base repository.safe_attributes = params[:repository] repository.project = project if repository.save - render :json => {repository.class.name.underscore.gsub('/', '-') => {:id => repository.id, :url => repository.url}}, :status => 201 + render :json => {repository.class.name.underscore.tr('/', '-') => {:id => repository.id, :url => repository.url}}, :status => 201 else head 422 end -- cgit v1.2.3