summaryrefslogtreecommitdiff
path: root/Kernel/KResult.h
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2021-02-07 14:12:13 -0700
committerAndreas Kling <kling@serenityos.org>2021-02-07 22:25:15 +0100
commitf74e31c74db3f9464e027eabb37e26f82c529543 (patch)
tree871e3835f346f5359aef49954b2b2bcba3a9ec4b /Kernel/KResult.h
parentad42d873e50e2285d1e38bd6bd02e5ff6308929c (diff)
downloadserenity-f74e31c74db3f9464e027eabb37e26f82c529543.zip
Kernel: Change KResultOr::take_value to use move semantics
This may be more light weight than copying the object.
Diffstat (limited to 'Kernel/KResult.h')
-rw-r--r--Kernel/KResult.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/KResult.h b/Kernel/KResult.h
index bc863b821f..8c7da0e079 100644
--- a/Kernel/KResult.h
+++ b/Kernel/KResult.h
@@ -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;