diff options
author | Andrew Newdigate <andrew@gitlab.com> | 2018-03-06 13:32:48 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-03-06 13:32:48 +0000 |
commit | b5ec6097b75819626083726d1073978d11aba7e3 (patch) | |
tree | 4e0dec2466b4fec72274710fdd8f824d84e7acee /app/models/network/commit.rb | |
parent | af84ccbd8227ac6d4d609bc8ff941ee6cad131f5 (diff) | |
download | gitlab-ce-b5ec6097b75819626083726d1073978d11aba7e3.tar.gz |
Fix Gitaly n+1 in NetworkController#show
Diffstat (limited to 'app/models/network/commit.rb')
-rw-r--r-- | app/models/network/commit.rb | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/app/models/network/commit.rb b/app/models/network/commit.rb index 9357e55b419..22d48c9e661 100644 --- a/app/models/network/commit.rb +++ b/app/models/network/commit.rb @@ -24,12 +24,7 @@ module Network end def parents(map) - @commit.parents.map do |p| - if map.include?(p.id) - map[p.id] - end - end - .compact + map.values_at(*@commit.parent_ids).compact end end end |