Patch #24713

Remove iteration in ApplicationHelper#syntax_highlight_lines

Added by Go MAEDA 9 months ago. Updated 9 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Code cleanup/refactoring
Target version:3.4.0

Description

Index: app/helpers/application_helper.rb
===================================================================
--- app/helpers/application_helper.rb    (revision 16111)
+++ app/helpers/application_helper.rb    (working copy)
@@ -466,9 +466,7 @@
   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)

Associated revisions

Revision 16164
Added by Jean-Philippe Lang 9 months ago

Remove iteration in ApplicationHelper#syntax_highlight_lines (#24713).

Patch by Go MAEDA.

History

#1 Updated by Toshi MARUYAMA 9 months ago

  • Target version set to 3.4.0

#2 Updated by Jean-Philippe Lang 9 months ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang

Committed, thanks.

Also available in: Atom PDF