mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 10:18:15 +09:00
Kernel: Tidy up InodeWatcher construction
- Rename create() => try_create() - Use adopt_nonnull_ref_or_enomem()
This commit is contained in:
parent
393229e2aa
commit
68a6d4c30a
Notes:
sideshowbarker
2024-07-18 04:44:30 +09:00
Author: https://github.com/awesomekling
Commit: 68a6d4c30a
3 changed files with 4 additions and 7 deletions
|
@ -12,12 +12,9 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
KResultOr<NonnullRefPtr<InodeWatcher>> InodeWatcher::create()
|
||||
KResultOr<NonnullRefPtr<InodeWatcher>> InodeWatcher::try_create()
|
||||
{
|
||||
auto watcher = adopt_ref_if_nonnull(new (nothrow) InodeWatcher);
|
||||
if (watcher)
|
||||
return watcher.release_nonnull();
|
||||
return ENOMEM;
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) InodeWatcher);
|
||||
}
|
||||
|
||||
InodeWatcher::~InodeWatcher()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue