diff options
author | Peter Leitzen <pleitzen@gitlab.com> | 2019-07-26 10:44:13 +0000 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2019-07-26 10:44:13 +0000 |
commit | 8136fac26c8f470720ff90d152b93abf50f5084d (patch) | |
tree | 3f50aab69d5c5841d9b5aa1c9a64804eea29d877 /app/models/concerns/protected_ref.rb | |
parent | 0d2b5bff8c524376f42316f1a4cc8cfbeabc2d8d (diff) | |
download | gitlab-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/concerns/protected_ref.rb')
-rw-r--r-- | app/models/concerns/protected_ref.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/concerns/protected_ref.rb b/app/models/concerns/protected_ref.rb index af387c99f3d..0648b4a78e1 100644 --- a/app/models/concerns/protected_ref.rb +++ b/app/models/concerns/protected_ref.rb @@ -47,7 +47,7 @@ module ProtectedRef def access_levels_for_ref(ref, action:, protected_refs: nil) self.matching(ref, protected_refs: protected_refs) - .map(&:"#{action}_access_levels").flatten + .flat_map(&:"#{action}_access_levels") end # Returns all protected refs that match the given ref name. |