Skip to content

Commit

Permalink
Move deference from capture to body
Browse files Browse the repository at this point in the history
  • Loading branch information
KangarooKoala committed Aug 12, 2023
1 parent 46b531e commit 4fa8483
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions wpilibc/src/main/native/cpp/event/BooleanEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ BooleanEvent::BooleanEvent(EventLoop* loop, std::function<bool()> condition)
m_condition(std::make_shared<std::function<bool()>>(condition)) {
m_state = std::make_shared<bool>((*m_condition)());
m_loop->Bind(
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
[condition = *m_condition, state = m_state] { *state = condition(); });
[condition = m_condition, state = m_state] { *state = (*condition)(); });
}

BooleanEvent::operator std::function<bool()>() {
Expand Down

0 comments on commit 4fa8483

Please sign in to comment.