This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-configuration.git
commit 85493000ea637a179e58c630fd79c020def76950 Author: Gary Gregory <[email protected]> AuthorDate: Sat Jul 16 12:59:15 2022 -0400 Use forEach() --- .../java/org/apache/commons/configuration2/tree/NodeTreeWalker.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/org/apache/commons/configuration2/tree/NodeTreeWalker.java b/src/main/java/org/apache/commons/configuration2/tree/NodeTreeWalker.java index 840f3e81..5d091850 100644 --- a/src/main/java/org/apache/commons/configuration2/tree/NodeTreeWalker.java +++ b/src/main/java/org/apache/commons/configuration2/tree/NodeTreeWalker.java @@ -89,9 +89,7 @@ public class NodeTreeWalker { private static <T> void dfs(final T node, final ConfigurationNodeVisitor<T> visitor, final NodeHandler<T> handler) { if (!visitor.terminate()) { visitor.visitBeforeChildren(node, handler); - for (final T c : handler.getChildren(node)) { - dfs(c, visitor, handler); - } + handler.getChildren(node).forEach(c -> dfs(c, visitor, handler)); if (!visitor.terminate()) { visitor.visitAfterChildren(node, handler); }
