Use less memory while counting lines

This commit is contained in:
Jacob Vosmaer 2016-01-28 15:02:44 +01:00
parent 53ddb8f2cc
commit 9109619ee6
1 changed files with 1 additions and 1 deletions

View File

@ -1,7 +1,7 @@
.file-content.code.js-syntax-highlight{ class: user_color_scheme }
.line-numbers
- if blob.data.present?
- blob.data.lines.each_index do |index|
- blob.data.each_line.each_with_index do |_, index|
- offset = defined?(first_line_number) ? first_line_number : 1
- i = index + offset
-# We're not using `link_to` because it is too slow once we get to thousands of lines.