mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02:00
Kernel: Enable early-returns from VFS::for_each_mount
This commit is contained in:
committed by
Andreas Kling
parent
735da58d44
commit
88ca12f037
Notes:
sideshowbarker
2024-07-18 01:43:09 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/88ca12f037f Pull-request: https://github.com/SerenityOS/serenity/pull/10707
@@ -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