Skip to content

Commit d0c6ca8

Browse files
authored
Update IsChildOf graph walk in LayersGraph.cs
It looks like the recursion here was intended to use the visited set of nodes as part of its traversal. In a quick test, I saw a Lottie json file load time go from 2 minutes down to 15 seconds.
1 parent e37426d commit d0c6ca8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/LottieData/Optimization/LayersGraph.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private bool IsChildOf(GraphNode node, HashSet<GraphNode> visited)
6666

6767
foreach (var parent in Parents)
6868
{
69-
if (parent.Equals(node) || parent.IsChildOf(node))
69+
if (parent.Equals(node) || parent.IsChildOf(node, visited))
7070
{
7171
return true;
7272
}

0 commit comments

Comments
 (0)