From 030b6f2a492bc0171df422a85bf5898d7a4d0da7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Wed, 3 Feb 2021 11:04:38 -0300 Subject: [PATCH] Rover: Simplify boolean expression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- Rover/ekf_check.cpp | 6 +----- Rover/mode_acro.cpp | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Rover/ekf_check.cpp b/Rover/ekf_check.cpp index e89f198a29..94bb8505da 100644 --- a/Rover/ekf_check.cpp +++ b/Rover/ekf_check.cpp @@ -112,11 +112,7 @@ bool Rover::ekf_over_threshold() return true; } - if (ekf_position_ok()) { - return false; - } - - return true; + return !ekf_position_ok(); } // ekf_position_ok - returns true if the ekf claims it's horizontal absolute position estimate is ok and home position is set diff --git a/Rover/mode_acro.cpp b/Rover/mode_acro.cpp index 10f4e37c39..7e1e589402 100644 --- a/Rover/mode_acro.cpp +++ b/Rover/mode_acro.cpp @@ -49,7 +49,7 @@ void ModeAcro::update() bool ModeAcro::requires_velocity() const { - return g2.motors.have_skid_steering()? false: true; + return !g2.motors.have_skid_steering(); } // sailboats in acro mode support user manually initiating tacking from transmitter