Skip to content

Commit

Permalink
Remove dead method
Browse files Browse the repository at this point in the history
  • Loading branch information
nabond251 committed Feb 1, 2024
1 parent 5e004ce commit b1b1fbe
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions src/Rearch/DataflowGraphNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,6 @@ internal abstract class DataflowGraphNode : IDisposable
/// </summary>
public abstract bool IsSuperPure { get; }

/// <summary>
/// Prune unused nodes from the network. Nodes are unused if nothing depends on them and they have no side effects.
/// </summary>
/// <param name="buildOrder">List of nodes to consider for pruning.</param>
/// <returns>List of nodes after pruning.</returns>
public static IEnumerable<DataflowGraphNode> GarbageCollectDisposableNodes(
IList<DataflowGraphNode> buildOrder)
{
var nonDisposable = new List<DataflowGraphNode>();

foreach (var node in buildOrder.Reverse())
{
var isDisposable = node.IsSuperPure && node.dependents.Count == 0;
if (isDisposable)
{
node.Dispose();
}
else
{
nonDisposable.Add(node);
}
}

return nonDisposable.AsEnumerable().Reverse();
}

/// <summary>
/// Updates node data.
/// </summary>
Expand Down

0 comments on commit b1b1fbe

Please sign in to comment.