Skip to content

Commit

Permalink
Turn if operation to a ternary operation
Browse files Browse the repository at this point in the history
  • Loading branch information
Emma03L committed Feb 4, 2024
1 parent 81d0769 commit 58aa2f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/leds/LedStrip.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ public Command blink(DoubleSupplier blinkTime) {
return this.run(
() -> {
setBlinkTime(blinkTime.getAsDouble());
if (currentColor == primary) currentColor = secondary;
else currentColor = primary;
currentColor = currentColor == primary ?
secondary : primary;

if (timer.advanceIfElapsed(this.blinkTime) && this.blinkTime > LedConstants.MINIMAL_BLINK_TIME) {
setSolidColor(currentColor);
Expand Down

0 comments on commit 58aa2f8

Please sign in to comment.