Skip to content

Commit 8ba61f0

Browse files
committed
Filter as many DiffNodes in Starfold as possible
This saves memory by shortening the list of possible candidates.
1 parent 6975bb6 commit 8ba61f0

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

  • src/main/java/org/variantsync/diffdetective/diff/difftree/transform

src/main/java/org/variantsync/diffdetective/diff/difftree/transform/Starfold.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@ public static Starfold IgnoreNodeOrder() {
2929
@Override
3030
public void transform(DiffTree diffTree) {
3131
// All non-artifact nodes are potential roots of stars.
32-
final List<DiffNode> macroNodes = diffTree.computeAllNodesThat(node -> !node.isCode());
33-
// System.out.println("Inspecting " + macroNodes.size() + " star root candidates.");
32+
final List<DiffNode> macroNodes = diffTree.computeAllNodesThat(Starfold::isStarRoot);
33+
// System.out.println("Inspecting " + macroNodes.size() + " star roots.");
3434
for (DiffNode macro : macroNodes) {
35-
if (isStarRoot(macro)) {
36-
// System.out.println("Found star root " + macro);
37-
foldStar(macro);
38-
}
35+
// System.out.println("Found star root " + macro);
36+
foldStar(macro);
3937
}
4038
}
4139

0 commit comments

Comments
 (0)