Kernel: Simplify WatchDescription::create()

This commit is contained in:
Andreas Kling 2021-09-05 21:40:01 +02:00
commit 540d62d3b2
Notes: sideshowbarker 2024-07-18 04:39:15 +09:00

View file

@ -26,10 +26,7 @@ struct WatchDescription {
static KResultOr<NonnullOwnPtr<WatchDescription>> create(int wd, Inode& inode, unsigned event_mask)
{
auto description = adopt_own_if_nonnull(new (nothrow) WatchDescription(wd, inode, event_mask));
if (description)
return description.release_nonnull();
return ENOMEM;
return adopt_nonnull_own_or_enomem(new (nothrow) WatchDescription(wd, inode, event_mask));
}
private: