From 4f81aa82e29e03da0ff8fed577ba4925661cfcfc 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] AP_LeakDetector: Simplify boolean expression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- libraries/AP_LeakDetector/AP_LeakDetector_Analog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_LeakDetector/AP_LeakDetector_Analog.cpp b/libraries/AP_LeakDetector/AP_LeakDetector_Analog.cpp index 36891119bc..558b3bc3ef 100644 --- a/libraries/AP_LeakDetector/AP_LeakDetector_Analog.cpp +++ b/libraries/AP_LeakDetector/AP_LeakDetector_Analog.cpp @@ -14,7 +14,7 @@ void AP_LeakDetector_Analog::read() if (source != NULL && leak_detector._pin[state.instance] >= 0) { source->set_pin(leak_detector._pin[state.instance]); state.status = source->voltage_average() > 2.0f; - state.status = state.status==leak_detector._default_reading[state.instance]?false:true; + state.status = state.status != leak_detector._default_reading[state.instance]; } else { state.status = false; }