mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 02:40:49 +00:00
Kernel: Enable early-returns from VFS::for_each_mount
This commit is contained in:
committed by
Andreas Kling
parent
735da58d44
commit
88ca12f037
@@ -724,11 +724,12 @@ KResult VirtualFileSystem::rmdir(StringView path, Custody& base)
|
||||
return parent_inode.remove_child(KLexicalPath::basename(path));
|
||||
}
|
||||
|
||||
void VirtualFileSystem::for_each_mount(Function<void(Mount const&)> callback) const
|
||||
void VirtualFileSystem::for_each_mount(Function<IterationDecision(Mount const&)> callback) const
|
||||
{
|
||||
m_mounts.with_shared([&](auto& mounts) {
|
||||
for (auto& mount : mounts) {
|
||||
callback(mount);
|
||||
if (callback(mount) == IterationDecision::Break)
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user