From c9a2fe5b80f87e987c9c27c490d25bf327543a1b Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 27 Feb 2026 11:04:46 -1000 Subject: [PATCH] Move HALF_MAX_UINT32 inside compute() function Only used within the function, matches the pattern of ROLLOVER_WINDOW. Co-Authored-By: Claude Opus 4.6 --- esphome/core/time_64.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/esphome/core/time_64.cpp b/esphome/core/time_64.cpp index 7e9ffe54cc9..60bcc95773b 100644 --- a/esphome/core/time_64.cpp +++ b/esphome/core/time_64.cpp @@ -16,10 +16,10 @@ namespace esphome { static const char *const TAG = "time_64"; -// Half the 32-bit range - used to detect rollovers vs normal time progression -static constexpr uint32_t HALF_MAX_UINT32 = std::numeric_limits::max() / 2; - uint64_t Millis64Impl::compute(uint32_t now) { + // Half the 32-bit range - used to detect rollovers vs normal time progression + static constexpr uint32_t HALF_MAX_UINT32 = std::numeric_limits::max() / 2; + // State variables for rollover tracking - static to persist across calls #ifdef ESPHOME_THREAD_MULTI_ATOMICS // Mutex for rollover serialization (taken only every ~49.7 days).