mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:57:35 +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 features_array = TRY(obj.add_array("features"sv));
|
||||||
auto keep_empty = SplitBehavior::KeepEmpty;
|
auto keep_empty = SplitBehavior::KeepEmpty;
|
||||||
|
|
||||||
ErrorOr<void> result; // FIXME: Make this nicer
|
TRY(info.features_string().for_each_split_view(' ', keep_empty, [&](StringView feature) {
|
||||||
info.features_string().for_each_split_view(' ', keep_empty, [&](StringView feature) {
|
return features_array.add(feature);
|
||||||
if (result.is_error())
|
}));
|
||||||
return;
|
|
||||||
result = features_array.add(feature);
|
|
||||||
});
|
|
||||||
TRY(result);
|
|
||||||
|
|
||||||
TRY(features_array.finish());
|
TRY(features_array.finish());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue