mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:58:11 +00:00
Kernel: Fix CPUInfo error propagation fixme
We can now propagate the errors directly from for_each_split_view(), which I think counts as "Make this nicer" :^)
This commit is contained in:
parent
012aaecccf
commit
83a59396c8
1 changed files with 3 additions and 7 deletions
|
@ -40,13 +40,9 @@ ErrorOr<void> SysFSCPUInformation::try_generate(KBufferBuilder& builder)
|
|||
auto features_array = TRY(obj.add_array("features"sv));
|
||||
auto keep_empty = SplitBehavior::KeepEmpty;
|
||||
|
||||
ErrorOr<void> result; // FIXME: Make this nicer
|
||||
info.features_string().for_each_split_view(' ', keep_empty, [&](StringView feature) {
|
||||
if (result.is_error())
|
||||
return;
|
||||
result = features_array.add(feature);
|
||||
});
|
||||
TRY(result);
|
||||
TRY(info.features_string().for_each_split_view(' ', keep_empty, [&](StringView feature) {
|
||||
return features_array.add(feature);
|
||||
}));
|
||||
|
||||
TRY(features_array.finish());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue