summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2016-01-28 15:02:44 +0100
committerJacob Vosmaer <contact@jacobvosmaer.nl>2016-01-28 15:02:44 +0100
commit9109619ee6fe85ee7e8ebfa51c6587319b523930 (patch)
tree41d4636e4c22119763eb25496c549cb3b24da97f
parent53ddb8f2ccaa95a19d530827e3fc7500d02ccfff (diff)
downloadgitlab-ce-9109619ee6fe85ee7e8ebfa51c6587319b523930.tar.gz
Use less memory while counting lines
-rw-r--r--app/views/shared/_file_highlight.html.haml2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/views/shared/_file_highlight.html.haml b/app/views/shared/_file_highlight.html.haml
index 2bc98983d67..331bad3ccf7 100644
--- a/app/views/shared/_file_highlight.html.haml
+++ b/app/views/shared/_file_highlight.html.haml
@@ -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.