From cc8eaf3ed7c058ffdcace4366c03d65016f08b59 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Mon, 12 May 2025 07:19:54 -0700 Subject: [PATCH] [wpilib] Remove unhelpful comments from BooleanEvent (#7970) These were apparently a meme about state being hard to manage rather than a statement about the code itself. I spent a while trying to find some complex logic this comment was alluding to that would indicate why it's "a nightmare to manage". --- wpilibc/src/main/native/include/frc/event/BooleanEvent.h | 6 +++++- .../main/java/edu/wpi/first/wpilibj/event/BooleanEvent.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/wpilibc/src/main/native/include/frc/event/BooleanEvent.h b/wpilibc/src/main/native/include/frc/event/BooleanEvent.h index e06a931988..c17c89c8f4 100644 --- a/wpilibc/src/main/native/include/frc/event/BooleanEvent.h +++ b/wpilibc/src/main/native/include/frc/event/BooleanEvent.h @@ -129,8 +129,12 @@ class BooleanEvent { frc::Debouncer::DebounceType::kRising); private: + /// Poller loop. EventLoop* m_loop; + std::function m_signal; - std::shared_ptr m_state; // A programmer's worst nightmare. + + /// The state of the condition in the current loop poll. + std::shared_ptr m_state; }; } // namespace frc diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/event/BooleanEvent.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/event/BooleanEvent.java index 53d5d62153..9369b7811a 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/event/BooleanEvent.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/event/BooleanEvent.java @@ -28,7 +28,7 @@ public class BooleanEvent implements BooleanSupplier { private final BooleanSupplier m_signal; - /** The state of the condition in the current loop poll. Nightmare to manage. */ + /** The state of the condition in the current loop poll. */ private final AtomicBoolean m_state = new AtomicBoolean(false); /**