mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 16:19:23 +00:00
Kernel: Make DoubleBuffer::try() return KResultOr
This tidies up error propagation in a number of places.
This commit is contained in:
parent
213b8868af
commit
01993d0af3
Notes:
sideshowbarker
2024-07-18 04:31:44 +09:00
Author: https://github.com/awesomekling
Commit: 01993d0af3
8 changed files with 23 additions and 32 deletions
|
@ -18,11 +18,11 @@ namespace Kernel {
|
|||
|
||||
RefPtr<MasterPTY> MasterPTY::try_create(unsigned int index)
|
||||
{
|
||||
auto buffer = DoubleBuffer::try_create();
|
||||
if (!buffer)
|
||||
auto buffer_or_error = DoubleBuffer::try_create();
|
||||
if (buffer_or_error.is_error())
|
||||
return {};
|
||||
|
||||
auto master_pty = adopt_ref_if_nonnull(new (nothrow) MasterPTY(index, buffer.release_nonnull()));
|
||||
auto master_pty = adopt_ref_if_nonnull(new (nothrow) MasterPTY(index, buffer_or_error.release_value()));
|
||||
if (!master_pty)
|
||||
return {};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue