Project

General

Profile

Actions

Patch #24713

closed

Remove iteration in ApplicationHelper#syntax_highlight_lines

Added by Go MAEDA about 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Category:
Code cleanup/refactoring
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

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)
Actions #1

Updated by Toshi MARUYAMA about 7 years ago

  • Target version set to 3.4.0
Actions #2

Updated by Jean-Philippe Lang about 7 years ago

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

Committed, thanks.

Actions

Also available in: Atom PDF