diff --git a/wpilibNewCommands/src/main/native/cpp/frc2/command/CommandPtr.cpp b/wpilibNewCommands/src/main/native/cpp/frc2/command/CommandPtr.cpp index f017808ac67..5bc63f7ffb4 100644 --- a/wpilibNewCommands/src/main/native/cpp/frc2/command/CommandPtr.cpp +++ b/wpilibNewCommands/src/main/native/cpp/frc2/command/CommandPtr.cpp @@ -54,11 +54,9 @@ CommandPtr CommandPtr::Repeatedly(int times) && { AssertValid(); std::shared_ptr countPtr = std::make_shared(0); return std::move(*this) - .FinallyDo([countPtr = countPtr] { (*countPtr)++; }) + .FinallyDo([countPtr] { (*countPtr)++; }) .Repeatedly() - .Until([countPtr = countPtr, times = times] { - return ((*countPtr) >= times); - }); + .Until([countPtr, times] { return ((*countPtr) >= times); }); } CommandPtr CommandPtr::AsProxy() && {