From 80a228383be1f312a0cacdb59d3f8a55ce72188e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kleines=20Filmr=C3=B6llchen?= Date: Thu, 25 May 2023 00:13:58 +0200 Subject: [PATCH] AK: Simplify MaybeOwned constructor The previous version had a sequence of calls that are likely not optimized out, while this version is strictly a sequence of static type conversion which are always fully optimized out. --- AK/MaybeOwned.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/MaybeOwned.h b/AK/MaybeOwned.h index 48ef03994f..433c886a0f 100644 --- a/AK/MaybeOwned.h +++ b/AK/MaybeOwned.h @@ -18,7 +18,7 @@ class MaybeOwned { public: template U> MaybeOwned(NonnullOwnPtr handle) - : m_handle(adopt_own(*handle.leak_ptr())) + : m_handle(static_cast&&>(move(handle))) { }