[ruby/yarp] Use compact_child_nodes where possible
https://github.com/ruby/yarp/commit/c1911fa9b1
This commit is contained in:
parent
54e676a88b
commit
1636f6abd6
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user