]> source.dussan.org Git - redmine.git/commitdiff
Remove iteration in ApplicationHelper#syntax_highlight_lines (#24713).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 8 Jan 2017 22:41:52 +0000 (22:41 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 8 Jan 2017 22:41:52 +0000 (22:41 +0000)
Patch by Go MAEDA.

git-svn-id: http://svn.redmine.org/redmine/trunk@16164 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb

index 30bd8eb140cb08471154c357286e59c076330451..13075126dfe44ee77145a6674c52b66019e63cb1 100644 (file)
@@ -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)