diff options
| author | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2017-10-11 22:49:16 -0300 |
|---|---|---|
| committer | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2017-10-11 22:49:16 -0300 |
| commit | 8923edffdb36b790014ff47301e53f7ede93ea0d (patch) | |
| tree | e1cff9168eb79110a8832249d208f2978f549a04 /base/src/main/java/bjc/utils/funcutils/TreeUtils.java | |
| parent | 946cab444bc301d8a7c756a1bab039558288de89 (diff) | |
Cleanup more
Diffstat (limited to 'base/src/main/java/bjc/utils/funcutils/TreeUtils.java')
| -rw-r--r-- | base/src/main/java/bjc/utils/funcutils/TreeUtils.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/base/src/main/java/bjc/utils/funcutils/TreeUtils.java b/base/src/main/java/bjc/utils/funcutils/TreeUtils.java index dcd5738..3308fb8 100644 --- a/base/src/main/java/bjc/utils/funcutils/TreeUtils.java +++ b/base/src/main/java/bjc/utils/funcutils/TreeUtils.java @@ -28,11 +28,10 @@ public class TreeUtils { return paths; } + /* Find a path in a tree. */ private static <T> void findPath(ITree<T> subtree, LinkedList<T> path, Predicate<T> leafMarker, IList<IList<T>> paths) { if(subtree.getChildrenCount() == 0 && leafMarker.test(subtree.getHead())) { - /* - * We're at a matching leaf node. Add it. - */ + /* We're at a matching leaf node. Add it. */ IList<T> finalPath = new FunctionalList<>(); for(T ePath : path) { @@ -43,9 +42,7 @@ public class TreeUtils { paths.add(finalPath); } else { - /* - * Check the children of this node. - */ + /* Check the children of this node. */ path.add(subtree.getHead()); subtree.doForChildren((child) -> findPath(child, path, leafMarker, paths)); |
