Skip to content

Commit f54449d

Browse files
committed
Refactor fully_qualified_nesting_namespaces
1 parent 7a6015a commit f54449d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/rdoc/code_object/class_module.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ def nesting_namespaces
309309

310310
def fully_qualified_nesting_namespaces
311311
return nesting_namespaces if nesting_namespaces.length < 2
312-
@fqns ||= nesting_namespaces.map.with_index do |_, i|
313-
nesting_namespaces[0..i].join("::")
312+
@fqns ||= nesting_namespaces.inject([]) do |list, n|
313+
list << (list.empty? ? n : "#{list.last}::#{n}")
314314
end
315315
end
316316

0 commit comments

Comments
 (0)