diff options
| author | Sean McGivern <sean@mcgivern.me.uk> | 2017-04-04 13:33:42 +0000 |
|---|---|---|
| committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-04-04 13:33:42 +0000 |
| commit | 796d65f1feeb13c5bbdedee3f7290bd962c4c421 (patch) | |
| tree | fee4fcfd24818c3bef0bde6faf1b6c1b51aeb887 /app/controllers | |
| parent | 7f8f927aafb0f3a618ccce76e802e30a16b04b42 (diff) | |
| parent | e52b1df1d5391f0fa0b9ec7eb2d3492b05f64ba4 (diff) | |
| download | gitlab-ce-796d65f1feeb13c5bbdedee3f7290bd962c4c421.tar.gz | |
Merge branch '29492-useless-queries' into 'master'
remove useless queries with false conditions (e.g 1=0)
Closes #29492
See merge request !10141
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/concerns/issuable_collections.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/controllers/concerns/issuable_collections.rb b/app/controllers/concerns/issuable_collections.rb index 85ae4985e58..c8a501d7319 100644 --- a/app/controllers/concerns/issuable_collections.rb +++ b/app/controllers/concerns/issuable_collections.rb @@ -15,6 +15,9 @@ module IssuableCollections # a new order into the collection. # We cannot use reorder to not mess up the paginated collection. issuable_ids = issuable_collection.map(&:id) + + return {} if issuable_ids.empty? + issuable_note_count = Note.count_for_collection(issuable_ids, @collection_type) issuable_votes_count = AwardEmoji.votes_for_collection(issuable_ids, @collection_type) issuable_merge_requests_count = |
