From 6c8e4ef5c9df5d45534ab0af6d4f3641c91bf172 Mon Sep 17 00:00:00 2001 From: Markus Ransberger Date: Sun, 7 Dec 2025 02:38:36 +0100 Subject: [PATCH] MInor refactoring --- src/connectivity/time_manager.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/connectivity/time_manager.cpp b/src/connectivity/time_manager.cpp index efd0353..0643e9a 100644 --- a/src/connectivity/time_manager.cpp +++ b/src/connectivity/time_manager.cpp @@ -44,12 +44,13 @@ bool TimeManager::ntp_sync_successful(void) const bool TimeManager::ntp_sync_overdue(void) { + bool retval = false; + if (!ntp_sync_successful()) { - return false; + return retval; } - bool retval = false; // after the ntp sync update delay has been reached six times, the sync is considered overdue if (_now >= (_ntp_sync_timestamp_s + (time_t)(6 * (sntp_update_delay_MS_rfc_not_less_than_15000() / 1000)))) { @@ -61,12 +62,13 @@ bool TimeManager::ntp_sync_overdue(void) bool TimeManager::ntp_sync_timeout(void) { + bool retval = false; + if (!ntp_sync_successful()) { - return false; + return retval; } - bool retval = false; // after the maxmimum offline time has been reached, the sync is considered timed out if (_now >= (_ntp_sync_timestamp_s + (time_t)_ntp_max_offline_time_s)) {