From faf08c2f95c16e27414079d71c05ee90dbb00654 Mon Sep 17 00:00:00 2001 From: Kaya <95276965+kytpbs@users.noreply.github.com> Date: Fri, 11 Oct 2024 00:54:04 +0300 Subject: [PATCH] use pass by value similar to convention I didn't know you could just pass by value by doing this thx @KangarooKoala for pointing it out. Co-Authored-By: Joseph Eng <91924258+KangarooKoala@users.noreply.github.com> --- .../src/main/native/cpp/frc2/command/CommandPtr.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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() && {