mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
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.
This commit is contained in:
parent
7a6b1f179b
commit
80a228383b
Notes:
sideshowbarker
2024-07-17 10:54:57 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/80a228383b Pull-request: https://github.com/SerenityOS/serenity/pull/19031 Reviewed-by: https://github.com/gmta ✅ Reviewed-by: https://github.com/nico ✅ Reviewed-by: https://github.com/timschumi ✅
1 changed files with 1 additions and 1 deletions
|
@ -18,7 +18,7 @@ class MaybeOwned {
|
|||
public:
|
||||
template<DerivedFrom<T> U>
|
||||
MaybeOwned(NonnullOwnPtr<U> handle)
|
||||
: m_handle(adopt_own<T>(*handle.leak_ptr()))
|
||||
: m_handle(static_cast<NonnullOwnPtr<T>&&>(move(handle)))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue