Skip to content

Commit

Permalink
use pass by value similar to convention
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
kytpbs and KangarooKoala committed Oct 10, 2024
1 parent 6e88f89 commit f0d8608
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ CommandPtr CommandPtr::Repeatedly(int times) && {
AssertValid();
std::shared_ptr<int> countPtr = std::make_shared<int>(0);
return std::move(*this)
.FinallyDo([countPtr = countPtr] { (*countPtr)++; })
.FinallyDo([countPtr] { (*countPtr)++; })
.Repeatedly()
.Until([countPtr = countPtr, times = times] {
.Until([countPtr, times] {
return ((*countPtr) >= times);
});
}
Expand Down

0 comments on commit f0d8608

Please sign in to comment.