mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
[wpiutil] uv: use move for std::function (#3653)
Also use function_ref for Loop::Walk().
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user