mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:17:36 +00:00
SpaceAnalyzer: Add a method to TreeNode to get a child node by name
This will make it easier to get to a tree node given a file path
This commit is contained in:
parent
0d67e60559
commit
ba33267132
2 changed files with 11 additions and 0 deletions
|
@ -128,3 +128,13 @@ HashMap<int, int> TreeNode::populate_filesize_tree(Vector<MountInfo>& mounts, Fu
|
|||
update_totals();
|
||||
return error_accumulator;
|
||||
}
|
||||
|
||||
Optional<TreeNode const&> TreeNode::child_with_name(DeprecatedString name) const
|
||||
{
|
||||
for (auto& child : *m_children) {
|
||||
if (child.name() == name)
|
||||
return child;
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue