mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
Kernel: Enable early-returns from VFS::for_each_mount
This commit is contained in:
parent
735da58d44
commit
88ca12f037
Notes:
sideshowbarker
2024-07-18 01:43:09 +09:00
Author: https://github.com/BenWiederhake
Commit: 88ca12f037
Pull-request: https://github.com/SerenityOS/serenity/pull/10707
4 changed files with 19 additions and 15 deletions
|
@ -351,7 +351,8 @@ private:
|
|||
virtual KResult try_generate(KBufferBuilder& builder) override
|
||||
{
|
||||
JsonArraySerializer array { builder };
|
||||
VirtualFileSystem::the().for_each_mount([&array](auto& mount) {
|
||||
KResult result = KSuccess;
|
||||
VirtualFileSystem::the().for_each_mount([&array, &result](auto& mount) {
|
||||
auto& fs = mount.guest_fs();
|
||||
auto fs_object = array.add_object();
|
||||
fs_object.add("class_name", fs.class_name());
|
||||
|
@ -368,6 +369,8 @@ private:
|
|||
fs_object.add("source", static_cast<const FileBackedFileSystem&>(fs).file_description().absolute_path());
|
||||
else
|
||||
fs_object.add("source", "none");
|
||||
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
array.finish();
|
||||
return KSuccess;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue