summaryrefslogtreecommitdiffstats
path: root/lib/redmine/nested_set/project_nested_set.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 /lib/redmine/nested_set/project_nested_set.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 'lib/redmine/nested_set/project_nested_set.rb')
-rw-r--r--lib/redmine/nested_set/project_nested_set.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/redmine/nested_set/project_nested_set.rb b/lib/redmine/nested_set/project_nested_set.rb
index bbf22e258..edd2fc765 100644
--- a/lib/redmine/nested_set/project_nested_set.rb
+++ b/lib/redmine/nested_set/project_nested_set.rb
@@ -121,7 +121,7 @@ module Redmine
def lock_nested_set
lock = true
- if self.class.connection.adapter_name =~ /sqlserver/i
+ if /sqlserver/i.match?(self.class.connection.adapter_name)
lock = "WITH (ROWLOCK HOLDLOCK UPDLOCK)"
end
self.class.order(:id).lock(lock).ids