mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 04:52:06 +02:00
Kernel: Stop using the make<T> factory method in the Kernel
As make<T> is infallible, it really should not be used anywhere in the Kernel. Instead replace with fallible `new (nothrow)` calls, that will eventually be error-propagated.
This commit is contained in:
committed by
Andreas Kling
parent
e5e7cb822a
commit
8289727fac
Notes:
sideshowbarker
2024-07-17 19:49:48 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/8289727fac6 Pull-request: https://github.com/SerenityOS/serenity/pull/12275
@@ -11,7 +11,7 @@ namespace Kernel {
|
||||
|
||||
Result<NonnullOwnPtr<EBRPartitionTable>, PartitionTable::Error> EBRPartitionTable::try_to_initialize(const StorageDevice& device)
|
||||
{
|
||||
auto table = make<EBRPartitionTable>(device);
|
||||
auto table = adopt_nonnull_own_or_enomem(new (nothrow) EBRPartitionTable(device)).release_value_but_fixme_should_propagate_errors();
|
||||
if (table->is_protective_mbr())
|
||||
return { PartitionTable::Error::MBRProtective };
|
||||
if (!table->is_valid())
|
||||
|
||||
Reference in New Issue
Block a user