From 72e1451159206af1c335b23e0c1e5bf9ed84bc85 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Wed, 27 Mar 2019 02:15:24 +0000 Subject: Use Regexp#match? to reduce allocations of MatchData object (#28940). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Pavel Rosický. git-svn-id: http://svn.redmine.org/redmine/trunk@18011 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/nested_set/issue_nested_set.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/redmine/nested_set/issue_nested_set.rb') diff --git a/lib/redmine/nested_set/issue_nested_set.rb b/lib/redmine/nested_set/issue_nested_set.rb index 0280c7a2d..985341e01 100644 --- a/lib/redmine/nested_set/issue_nested_set.rb +++ b/lib/redmine/nested_set/issue_nested_set.rb @@ -151,7 +151,7 @@ module Redmine end def lock_nested_set - if self.class.connection.adapter_name =~ /sqlserver/i + if /sqlserver/i.match?(self.class.connection.adapter_name) lock = "WITH (ROWLOCK HOLDLOCK UPDLOCK)" # Custom lock for SQLServer # This can be problematic if root_id or parent root_id changes -- cgit v1.2.3