[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

@@ -24,8 +24,8 @@ void Timer::SingleShot(Loop& loop, Time timeout, std::function<void()> func) {
if (!h) {
return;
}
h->timeout.connect([theTimer = h.get(), func]() {
func();
h->timeout.connect([theTimer = h.get(), f = std::move(func)]() {
f();
theTimer->Close();
});
h->Start(timeout);