MInor refactoring

This commit is contained in:
2025-12-07 02:38:36 +01:00
parent 6cb023d96c
commit 6c8e4ef5c9

View File

@@ -44,12 +44,13 @@ bool TimeManager::ntp_sync_successful(void) const
bool TimeManager::ntp_sync_overdue(void) bool TimeManager::ntp_sync_overdue(void)
{ {
bool retval = false;
if (!ntp_sync_successful()) 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 // 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)))) 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 TimeManager::ntp_sync_timeout(void)
{ {
bool retval = false;
if (!ntp_sync_successful()) 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 // 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)) if (_now >= (_ntp_sync_timestamp_s + (time_t)_ntp_max_offline_time_s))
{ {