Kernel: Change KResultOr::take_value to use move semantics
This may be more light weight than copying the object.
This commit is contained in:
parent
ad42d873e5
commit
f74e31c74d
Notes:
sideshowbarker
2024-07-18 22:31:52 +09:00
Author: https://github.com/tomuta Commit: https://github.com/SerenityOS/serenity/commit/f74e31c74db Pull-request: https://github.com/SerenityOS/serenity/pull/5260
1 changed files with 1 additions and 1 deletions
|
@ -163,7 +163,7 @@ public:
|
|||
{
|
||||
ASSERT(!m_is_error);
|
||||
ASSERT(m_have_storage);
|
||||
T released_value = *reinterpret_cast<T*>(&m_storage);
|
||||
T released_value(move(*reinterpret_cast<T*>(&m_storage)));
|
||||
value().~T();
|
||||
m_have_storage = false;
|
||||
return released_value;
|
||||
|
|
Loading…
Add table
Reference in a new issue