From bd5977d97eaf92f852c1bfe499052b6b07ab8aae Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sun, 17 Mar 2019 13:36:03 +0000 Subject: Support frozen_string_literal in app/**/*.rb (#26561). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Contributed by Pavel Rosický. git-svn-id: http://svn.redmine.org/redmine/trunk@17987 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/search_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/helpers/search_helper.rb') diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index f236f3181..0b0160c6b 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang @@ -22,7 +22,7 @@ module SearchHelper return text unless text && tokens && !tokens.empty? re_tokens = tokens.collect {|t| Regexp.escape(t)} regexp = Regexp.new "(#{re_tokens.join('|')})", Regexp::IGNORECASE - result = '' + result = +'' text.split(regexp).each_with_index do |words, i| if result.length > 1200 # maximum length of the preview reached -- cgit v1.2.3