summaryrefslogtreecommitdiff
path: root/app/views/search
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2016-03-03 19:23:50 +0000
committerJacob Vosmaer <contact@jacobvosmaer.nl>2016-03-03 19:23:50 +0000
commitbd269eaab993c4f2faa03e0e3a5cef72a82d3f2b (patch)
tree214d04b04924a0343e8440e1d0020db44e182c61 /app/views/search
parent47b0c6b574ad87322fd1f7b8f8bea6686230ddf0 (diff)
parent1764e1b7cb2bffb9b4c4a69991fe2c4d21ce5459 (diff)
downloadgitlab-ce-bd269eaab993c4f2faa03e0e3a5cef72a82d3f2b.tar.gz
Merge branch 'lazy-diffs' into 'master'
Lazy diffs Needs https://gitlab.com/gitlab-org/gitlab_git/merge_requests/65 Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/10785 - Use Gitlab::Git::DiffCollection which limits the result set size. This avoids loading unnecessary data from Git/SQL into memory. - Remove left-over Grit timeout handling code. - Use Gitlab::Git::Count.lines to count lines in strings. - Use more iterators. See merge request !2705
Diffstat (limited to 'app/views/search')
-rw-r--r--app/views/search/results/_snippet_blob.html.haml2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/views/search/results/_snippet_blob.html.haml b/app/views/search/results/_snippet_blob.html.haml
index 6b77d24f50c..c9b7bd154af 100644
--- a/app/views/search/results/_snippet_blob.html.haml
+++ b/app/views/search/results/_snippet_blob.html.haml
@@ -30,7 +30,7 @@
.line-numbers
- snippet_chunks.each do |chunk|
- unless chunk[:data].empty?
- - chunk[:data].lines.to_a.size.times do |index|
+ - Gitlab::Git::Util.count_lines(chunk[:data]).times do |index|
- offset = defined?(chunk[:start_line]) ? chunk[:start_line] : 1
- i = index + offset
= link_to snippet_path+"#L#{i}", id: "L#{i}", rel: "#L#{i}", class: "diff-line-num" do