Skip to content

Commit

Permalink
Simplify enqueueing
Browse files Browse the repository at this point in the history
  • Loading branch information
dduugg committed Dec 2, 2023
1 parent e2650f1 commit 8ea65e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/yard-sorbet/node_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def self.bfs_traverse(node, &_blk)
# Enqueue the eligible children of a node in the BFS queue
sig { params(queue: Queue, node: YARD::Parser::Ruby::AstNode).void }
def self.enque_children(queue, node)
num_children = node.children.size
node.children.each_with_index do |child, i|
next if i == num_children - 1 &&
last_child = node.children.last
node.children.each do |child|
next if child == last_child &&
node.is_a?(YARD::Parser::Ruby::MethodCallNode) &&
SKIP_METHOD_CONTENTS.include?(node.method_name(true))

Expand Down

0 comments on commit 8ea65e3

Please sign in to comment.