mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:48:10 +00:00
AK: Make RedBlackTree::try_insert() return ErrorOr<void> instead of bool
This commit is contained in:
parent
b285323d91
commit
0f22ba5bf2
2 changed files with 6 additions and 7 deletions
|
@ -267,8 +267,7 @@ ErrorOr<Region*> AddressSpace::add_region(NonnullOwnPtr<Region> region)
|
|||
{
|
||||
auto* ptr = region.ptr();
|
||||
SpinlockLocker lock(m_lock);
|
||||
if (!m_regions.try_insert(region->vaddr().get(), move(region)))
|
||||
return ENOMEM;
|
||||
TRY(m_regions.try_insert(region->vaddr().get(), move(region)));
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue