mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 03:25:13 +00:00
LibThreading: Pass ownership of a BackgroundAction result to its caller
There is no need to create a copy of potentially expensive structures.
This commit is contained in:
parent
f20aa82c27
commit
5f9ed343b3
Notes:
github-actions[bot]
2025-02-10 16:06:43 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/5f9ed343b3a Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3519 Reviewed-by: https://github.com/AtkinsSJ ✅ Reviewed-by: https://github.com/shannonbooth
1 changed files with 1 additions and 1 deletions
|
@ -65,7 +65,7 @@ private:
|
|||
promise->on_resolution = [](NonnullRefPtr<Core::EventReceiver>& object) -> ErrorOr<void> {
|
||||
auto self = static_ptr_cast<BackgroundAction<Result>>(object);
|
||||
VERIFY(self->m_result.has_value());
|
||||
if (auto maybe_error = self->m_on_complete(self->m_result.value()); maybe_error.is_error())
|
||||
if (auto maybe_error = self->m_on_complete(self->m_result.release_value()); maybe_error.is_error())
|
||||
self->m_on_error(maybe_error.release_error());
|
||||
|
||||
return {};
|
||||
|
|
Loading…
Add table
Reference in a new issue