From 0c9e08af05637b901b075fe9a46626f5adca669c Mon Sep 17 00:00:00 2001 From: GHOSCHT <31184695+GHOSCHT@users.noreply.github.com> Date: Thu, 30 Mar 2023 20:08:25 +0200 Subject: [PATCH] Remove unnecessary ternary operator --- Firmware/src/FreeRTOS/BinarySemaphore.cpp | 4 ++-- Firmware/src/FreeRTOS/Mutex.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Firmware/src/FreeRTOS/BinarySemaphore.cpp b/Firmware/src/FreeRTOS/BinarySemaphore.cpp index 96464ae..a0fb7d6 100644 --- a/Firmware/src/FreeRTOS/BinarySemaphore.cpp +++ b/Firmware/src/FreeRTOS/BinarySemaphore.cpp @@ -14,11 +14,11 @@ auto freertos::BinarySemaphore::operator=( } auto freertos::BinarySemaphore::take(TickType_t timeout) -> bool { BaseType_t success = xSemaphoreTake(handle, timeout); - return success == pdTRUE ? true : false; + return success == pdTRUE; } auto freertos::BinarySemaphore::give() -> bool { BaseType_t success = xSemaphoreGive(handle); - return success == pdTRUE ? true : false; + return success == pdTRUE; } auto freertos::BinarySemaphore::getCount() -> size_t { diff --git a/Firmware/src/FreeRTOS/Mutex.cpp b/Firmware/src/FreeRTOS/Mutex.cpp index 7f8683a..b1786a1 100644 --- a/Firmware/src/FreeRTOS/Mutex.cpp +++ b/Firmware/src/FreeRTOS/Mutex.cpp @@ -12,9 +12,9 @@ auto freertos::Mutex::operator=(const Mutex &&other) noexcept -> Mutex & { } auto freertos::Mutex::lock(TickType_t timeout) -> bool{ BaseType_t success = xSemaphoreTake(handle, timeout); - return success == pdTRUE ? true : false; + return success == pdTRUE; } auto freertos::Mutex::unlock() -> bool { BaseType_t success = xSemaphoreGive(handle); - return success == pdTRUE ? true : false; + return success == pdTRUE; } \ No newline at end of file