diff options
| author | Kevin Newton <kddnewton@gmail.com> | 2023-09-15 18:38:31 -0400 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2023-09-18 17:48:52 +0000 |
| commit | 1636f6abd62c03f77777d83324df3bfcedbe66c2 (patch) | |
| tree | 43b3734dd376ba36edd756e85b430e92910f0828 | |
| parent | 54e676a88ba1a68b7302a32dad8c44197b55d5fe (diff) | |
[ruby/yarp] Use compact_child_nodes where possible
https://github.com/ruby/yarp/commit/c1911fa9b1
| -rw-r--r-- | lib/yarp.rb | 2 | ||||
| -rw-r--r-- | lib/yarp/pattern.rb | 2 | ||||
| -rw-r--r-- | test/yarp/parse_serialize_test.rb | 2 | ||||
| -rw-r--r-- | test/yarp/parse_test.rb | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/lib/yarp.rb b/lib/yarp.rb index 48b1f173dd..28f0fae003 100644 --- a/lib/yarp.rb +++ b/lib/yarp.rb @@ -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 diff --git a/lib/yarp/pattern.rb b/lib/yarp/pattern.rb index 339f1506c3..f7519137e4 100644 --- a/lib/yarp/pattern.rb +++ b/lib/yarp/pattern.rb @@ -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 diff --git a/test/yarp/parse_serialize_test.rb b/test/yarp/parse_serialize_test.rb index d3474f7104..18ff0c4319 100644 --- a/test/yarp/parse_serialize_test.rb +++ b/test/yarp/parse_serialize_test.rb @@ -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 diff --git a/test/yarp/parse_test.rb b/test/yarp/parse_test.rb index 0b470f6eed..eba5767776 100644 --- a/test/yarp/parse_test.rb +++ b/test/yarp/parse_test.rb @@ -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 |
