summaryrefslogtreecommitdiffstats
path: root/app/helpers/queries_helper.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/helpers/queries_helper.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/helpers/queries_helper.rb')
-rw-r--r--app/helpers/queries_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb
index 24207b4c1..bc9752cb6 100644
--- a/app/helpers/queries_helper.rb
+++ b/app/helpers/queries_helper.rb
@@ -30,7 +30,7 @@ module QueriesHelper
group = :label_relations
elsif field_options[:type] == :tree
group = query.is_a?(IssueQuery) ? :label_relations : nil
- elsif field =~ /^cf_\d+\./
+ elsif /^cf_\d+\./.match?(field)
group = (field_options[:through] || field_options[:field]).try(:name)
elsif field =~ /^(.+)\./
# association filters