Move varint_slow to private

It has a precondition (value >= 128) and should not be callable
from outside the class.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
J. Nick Koston
2026-03-07 15:41:45 -10:00
co-authored by Claude Opus 4.6
parent a5780eec54
commit 8ae54656fc
+2 -2
View File
@@ -518,10 +518,10 @@ class ProtoSize {
return varint_wide(value);
return varint_slow(value);
}
// Slow path for varint >= 128, outlined to keep fast path small
static uint32_t varint_slow(uint32_t value) __attribute__((noinline));
private:
// Slow path for varint >= 128, outlined to keep fast path small
static uint32_t varint_slow(uint32_t value) __attribute__((noinline));
// Shared cascade for values >= 128 (used by both constexpr and noinline paths)
static constexpr inline uint32_t ESPHOME_ALWAYS_INLINE varint_wide(uint32_t value) {
if (value < 16384)