Skip to content

Commit

Permalink
Change function parameter into rvalue referece
Browse files Browse the repository at this point in the history
  • Loading branch information
seungsoo47 committed Jan 6, 2025
1 parent 01200c1 commit 00fe195
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
MessageDispatcher::MessageDispatcher() { ecore_init(); }
MessageDispatcher::~MessageDispatcher() { ecore_shutdown(); }

void MessageDispatcher::dispatchTaskOnMainThread(std::function<void()> fn) {
void MessageDispatcher::dispatchTaskOnMainThread(std::function<void()>&& fn) {
ecore_main_loop_thread_safe_call_sync(
[](void* data) -> void* {
auto fn = static_cast<std::function<void()>*>(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MessageDispatcher {
MessageDispatcher();
~MessageDispatcher();

void dispatchTaskOnMainThread(std::function<void()> fn);
void dispatchTaskOnMainThread(std::function<void()>&& fn);
};

#endif // FLUTTER_PLUGIN_MESSAGE_DISPATCHER_H_

0 comments on commit 00fe195

Please sign in to comment.