summaryrefslogtreecommitdiff
path: root/lib/rdoc/ri/driver.rb
diff options
context:
space:
mode:
authorUlysse Buonomo <buonomo.ulysse@gmail.com>2021-06-27 00:33:34 +0200
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-07-05 11:34:25 +0900
commitec9a9af3754671cd066eb9827c4207b36a5f9dba (patch)
tree4dfc6eadde3439a50674e801b355d1866a778699 /lib/rdoc/ri/driver.rb
parentc7d1989986becc0e403afc35ad4caa5806e787be (diff)
[ruby/rdoc] Fix chained inclusion ancestors_of
Fixes #814 Signed-off-by: Ulysse Buonomo <buonomo.ulysse@gmail.com> https://github.com/ruby/rdoc/commit/b45f747216
Diffstat (limited to 'lib/rdoc/ri/driver.rb')
-rw-r--r--lib/rdoc/ri/driver.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/rdoc/ri/driver.rb b/lib/rdoc/ri/driver.rb
index 0408cbb0aa..7549a39203 100644
--- a/lib/rdoc/ri/driver.rb
+++ b/lib/rdoc/ri/driver.rb
@@ -616,11 +616,11 @@ or the PAGER environment variable.
stores = classes[current]
- break unless stores and not stores.empty?
+ next unless stores and not stores.empty?
- klasses = stores.map do |store|
- store.ancestors[current]
- end.flatten.uniq
+ klasses = stores.flat_map do |store|
+ store.ancestors[current] || []
+ end.uniq
klasses = klasses - seen