[ruby/yarp] Use compact_child_nodes where possible

https://github.com/ruby/yarp/commit/c1911fa9b1
This commit is contained in:
Kevin Newton 2023-09-15 18:38:31 -04:00 committed by git
parent 54e676a88b
commit 1636f6abd6
4 changed files with 4 additions and 4 deletions

View File

@ -520,7 +520,7 @@ module YARP
locals << [] if node.once?
end
stack.concat(node.child_nodes.compact)
stack.concat(node.compact_child_nodes)
end
locals

View File

@ -73,7 +73,7 @@ module YARP
while (node = queue.shift)
yield node if @compiled.call(node)
queue.concat(node.child_nodes.compact)
queue.concat(node.compact_child_nodes)
end
end

View File

@ -31,7 +31,7 @@ module YARP
while (node = queue.shift)
return node if node.is_a?(SourceFileNode)
queue.concat(node.child_nodes.compact)
queue.concat(node.compact_child_nodes)
end
end
end

View File

@ -204,7 +204,7 @@ module YARP
queue = [program]
while (node = queue.shift)
return node if node.is_a?(SourceFileNode)
queue.concat(node.child_nodes.compact)
queue.concat(node.compact_child_nodes)
end
end