summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-08 22:41:52 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-08 22:41:52 +0000
commite5d15c031bd781895364741aa5834d3f91a0d497 (patch)
treef31558a701e7a672d42b4b19c053a350c7fba911
parentaa030bf39ac6fd92829ad5977283d8b7331f551a (diff)
downloadredmine-e5d15c031bd781895364741aa5834d3f91a0d497.tar.gz
redmine-e5d15c031bd781895364741aa5834d3f91a0d497.zip
Remove iteration in ApplicationHelper#syntax_highlight_lines (#24713).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@16164 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/helpers/application_helper.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 30bd8eb14..13075126d 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -466,9 +466,7 @@ module ApplicationHelper
end
def syntax_highlight_lines(name, content)
- lines = []
- syntax_highlight(name, content).each_line { |line| lines << line }
- lines
+ syntax_highlight(name, content).each_line.to_a
end
def syntax_highlight(name, content)