summaryrefslogtreecommitdiff
path: root/qa/qa/page/validator.rb
diff options
context:
space:
mode:
authorPeter Leitzen <pleitzen@gitlab.com>2019-07-18 07:46:42 +0200
committerPeter Leitzen <pleitzen@gitlab.com>2019-07-18 07:46:42 +0200
commitc6f5994e1d2603df27e9f984620f8452df5c5726 (patch)
tree3980be72ee6fd125de6c5cc256b78f4ce22e94a0 /qa/qa/page/validator.rb
parent7fc35ac124f6437e4d04f17416a4e8af9f7a220b (diff)
downloadgitlab-ce-pl-flat_map-qa.tar.gz
QA: Prefer `flat_map` over `map` + `flatten`pl-flat_map-qa
Diffstat (limited to 'qa/qa/page/validator.rb')
-rw-r--r--qa/qa/page/validator.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/qa/qa/page/validator.rb b/qa/qa/page/validator.rb
index edd12665f1e..9b2d0a1a41d 100644
--- a/qa/qa/page/validator.rb
+++ b/qa/qa/page/validator.rb
@@ -22,16 +22,14 @@ module QA
end
def descendants
- @descendants ||= constants.map do |const|
+ @descendants ||= constants.flat_map do |const|
case const
when Class
const if const < Page::Base
when Module
Page::Validator.new(const).descendants
end
- end
-
- @descendants.flatten.compact
+ end.compact
end
def errors