[wpiutil] uv: use move for std::function (#3653)

Also use function_ref for Loop::Walk().
This commit is contained in:
Peter Johnson
2021-10-20 23:24:59 -07:00
committed by GitHub
parent 75fa1fbfbf
commit ac2f44da33
22 changed files with 55 additions and 42 deletions

View File

@@ -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()) {