mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpiutil] uv: use move for std::function (#3653)
Also use function_ref for Loop::Walk().
This commit is contained in:
@@ -65,7 +65,7 @@ void EventLoopRunner::Stop() {
|
||||
void EventLoopRunner::ExecAsync(LoopFunc func) {
|
||||
if (auto thr = m_owner.GetThread()) {
|
||||
if (auto doExec = thr->m_doExec.lock()) {
|
||||
doExec->Call(func);
|
||||
doExec->Call(std::move(func));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ void EventLoopRunner::ExecSync(LoopFunc func) {
|
||||
wpi::future<void> f;
|
||||
if (auto thr = m_owner.GetThread()) {
|
||||
if (auto doExec = thr->m_doExec.lock()) {
|
||||
f = doExec->Call(func);
|
||||
f = doExec->Call(std::move(func));
|
||||
}
|
||||
}
|
||||
if (f.valid()) {
|
||||
|
||||
Reference in New Issue
Block a user