Skip to content

Commit

Permalink
Removed dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
halgari committed Aug 29, 2023
1 parent 744f5a0 commit 3472bae
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions src/NexusMods.Paths/FileTree/FileTreeNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ public IEnumerable<FileTreeNode<TPath, TValue>> FindSubPath(RelativePath subpath
}
}


/// <summary>
/// Gets all nodes in the tree.
/// </summary>
Expand All @@ -264,26 +263,6 @@ public IEnumerable<FileTreeNode<TPath, TValue>> FindSubPath(RelativePath subpath

}

private static IEnumerable<FileTreeNode<TPath, TValue>> FindSubPath(FileTreeNode<TPath, TValue> node, RelativePath subpath, RelativePath[] parts, int index)
{
var part = parts[index];
if (!node.Children.TryGetValue(part, out var found)) yield break;

if (index == parts.Length - 1)
{
yield return found;
yield break;
}

foreach (var (_, childNode) in found.Children)
{
foreach (var itm in FindSubPath(childNode, subpath, parts, index + 1))
{
yield return itm;
}
}
}

/// <summary>
/// Populates the tree with the given collection of file entries.
/// </summary>
Expand Down

0 comments on commit 3472bae

Please sign in to comment.