diff --git a/libraries/AP_LeakDetector/AP_LeakDetector_Digital.cpp b/libraries/AP_LeakDetector/AP_LeakDetector_Digital.cpp
index e32da3fde7..5a1674747f 100644
--- a/libraries/AP_LeakDetector/AP_LeakDetector_Digital.cpp
+++ b/libraries/AP_LeakDetector/AP_LeakDetector_Digital.cpp
@@ -11,7 +11,7 @@ void AP_LeakDetector_Digital::read()
 {
     if (leak_detector._pin[state.instance] >= 0) {
         hal.gpio->pinMode(leak_detector._pin[state.instance], HAL_GPIO_INPUT);
-        state.status = hal.gpio->read(leak_detector._pin[state.instance])==leak_detector._default_reading[state.instance]?false:true;
+        state.status = hal.gpio->read(leak_detector._pin[state.instance]) != leak_detector._default_reading[state.instance];
     } else {
         state.status = false;
     }