summaryrefslogtreecommitdiffstats
path: root/app/controllers/repositories_controller.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-03-27 02:15:24 +0000
committerGo MAEDA <maeda@farend.jp>2019-03-27 02:15:24 +0000
commit72e1451159206af1c335b23e0c1e5bf9ed84bc85 (patch)
tree598902ed0066c4b292a6c1612aad4b203cbb81de /app/controllers/repositories_controller.rb
parentf0d579adebfe3c5da93135fbaa3d9ec503d06855 (diff)
downloadredmine-72e1451159206af1c335b23e0c1e5bf9ed84bc85.tar.gz
redmine-72e1451159206af1c335b23e0c1e5bf9ed84bc85.zip
Use Regexp#match? to reduce allocations of MatchData object (#28940).
Patch by Pavel Rosický. git-svn-id: http://svn.redmine.org/redmine/trunk@18011 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/repositories_controller.rb')
-rw-r--r--app/controllers/repositories_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index ff950799b..85b421e77 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -320,7 +320,7 @@ class RepositoriesController < ApplicationController
@rev = params[:rev].blank? ? @repository.default_branch : params[:rev].to_s.strip
@rev_to = params[:rev_to]
- unless @rev.to_s.match(REV_PARAM_RE) && @rev_to.to_s.match(REV_PARAM_RE)
+ unless REV_PARAM_RE.match?(@rev.to_s) && REV_PARAM_RE.match?(@rev_to.to_s)
if @repository.branches.blank?
raise InvalidRevisionParam
end