summaryrefslogtreecommitdiff
path: root/app/models/group.rb
diff options
context:
space:
mode:
authorPeter Leitzen <pleitzen@gitlab.com>2019-07-26 10:44:13 +0000
committerLin Jen-Shin <godfat@godfat.org>2019-07-26 10:44:13 +0000
commit8136fac26c8f470720ff90d152b93abf50f5084d (patch)
tree3f50aab69d5c5841d9b5aa1c9a64804eea29d877 /app/models/group.rb
parent0d2b5bff8c524376f42316f1a4cc8cfbeabc2d8d (diff)
downloadgitlab-ce-8136fac26c8f470720ff90d152b93abf50f5084d.tar.gz
Prefer `flat_map` over `map` + `flatten`
Convert several occurrences of `map` + `flatten` to `flat_map` where applicable.
Diffstat (limited to 'app/models/group.rb')
-rw-r--r--app/models/group.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/group.rb b/app/models/group.rb
index 26ce2957e9b..65a6705b6c0 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -388,7 +388,7 @@ class Group < Namespace
variables = Ci::GroupVariable.where(group: list_of_ids)
variables = variables.unprotected unless project.protected_for?(ref)
variables = variables.group_by(&:group_id)
- list_of_ids.reverse.map { |group| variables[group.id] }.compact.flatten
+ list_of_ids.reverse.flat_map { |group| variables[group.id] }.compact
end
def group_member(user)