diff options
author | Stan Hu <stanhu@gmail.com> | 2018-08-21 10:47:04 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-08-22 06:28:31 -0700 |
commit | 5138d659b5b16ebeadf37165bc461c5906f53e8e (patch) | |
tree | 9bd8f39002d58b8312cd0455f2e30e3aa2db13a3 /app/helpers | |
parent | f3d9e19b02b57a15d9ba34b2bfd8756b3eb8b2bd (diff) | |
download | gitlab-ce-5138d659b5b16ebeadf37165bc461c5906f53e8e.tar.gz |
Speed up diff comparisons by limiting number of commit messages rendered
When a diff has a significant number of commits, the previous behavior would
attempt to render the Markdown on all the commit messages but only display
1000 of them. To avoid additional work, we only need to render the Markdown
on the set that is displayed.
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/commits_helper.rb | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index 89fe90fd801..7a942c44ac4 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -210,17 +210,6 @@ module CommitsHelper Sanitize.clean(string, remove_contents: true) end - def limited_commits(commits) - if commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE - [ - commits.first(MergeRequestDiff::COMMITS_SAFE_SIZE), - commits.size - MergeRequestDiff::COMMITS_SAFE_SIZE - ] - else - [commits, 0] - end - end - def commit_path(project, commit, merge_request: nil) if merge_request&.persisted? diffs_project_merge_request_path(project, merge_request, commit_id: commit.id) |