diff options
author | Go MAEDA <maeda@farend.jp> | 2019-03-27 02:15:24 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2019-03-27 02:15:24 +0000 |
commit | 72e1451159206af1c335b23e0c1e5bf9ed84bc85 (patch) | |
tree | 598902ed0066c4b292a6c1612aad4b203cbb81de /app/models/repository | |
parent | f0d579adebfe3c5da93135fbaa3d9ec503d06855 (diff) | |
download | redmine-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/models/repository')
-rw-r--r-- | app/models/repository/mercurial.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/repository/mercurial.rb b/app/models/repository/mercurial.rb index a0560735f..2033a7317 100644 --- a/app/models/repository/mercurial.rb +++ b/app/models/repository/mercurial.rb @@ -98,7 +98,7 @@ class Repository::Mercurial < Repository def find_changeset_by_name(name) return nil if name.blank? s = name.to_s - if /[^\d]/ =~ s or s.size > 8 + if /[^\d]/.match?(s) || s.size > 8 cs = changesets.where(:scmid => s).first else cs = changesets.find_by(:revision => s) |