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.
@@ -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)))
{
}