diff options
Diffstat (limited to 'lib/gitlab/project_search_results.rb')
-rw-r--r-- | lib/gitlab/project_search_results.rb | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/lib/gitlab/project_search_results.rb b/lib/gitlab/project_search_results.rb index 29277ec6481..6a3aa9a7ca2 100644 --- a/lib/gitlab/project_search_results.rb +++ b/lib/gitlab/project_search_results.rb @@ -30,17 +30,7 @@ module Gitlab end def limited_notes_count - return @limited_notes_count if defined?(@limited_notes_count) - - types = %w(issue merge_request commit snippet) - @limited_notes_count = 0 - - types.each do |type| - @limited_notes_count += notes_finder(type).limit(count_limit).count - break if @limited_notes_count >= count_limit - end - - @limited_notes_count + @notes_count ||= notes.limit(count_limit).count end def wiki_blobs_count @@ -117,11 +107,7 @@ module Gitlab end def notes - @notes ||= notes_finder(nil) - end - - def notes_finder(type) - NotesFinder.new(project, @current_user, search: query, target_type: type).execute.user.order('updated_at DESC') + @notes ||= NotesFinder.new(project, @current_user, search: query).execute.user.order('updated_at DESC') end def commits |