From 44b50055afa8291398b09eea3fa0e7b61901a474 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 7 Mar 2026 15:31:33 -1000 Subject: [PATCH] Rename varint_slow_ to varint_slow for clang-tidy naming Static methods use lower_snake_case without trailing underscore. The trailing underscore convention is for member fields only. Co-Authored-By: Claude Opus 4.6 --- esphome/components/api/proto.cpp | 2 +- esphome/components/api/proto.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/esphome/components/api/proto.cpp b/esphome/components/api/proto.cpp index 6348c74c5f..4f16815d1b 100644 --- a/esphome/components/api/proto.cpp +++ b/esphome/components/api/proto.cpp @@ -8,7 +8,7 @@ namespace esphome::api { static const char *const TAG = "api.proto"; -uint32_t ProtoSize::varint_slow_(uint32_t value) { +uint32_t ProtoSize::varint_slow(uint32_t value) { // value is guaranteed >= 128 here (fast path handled inline) if (value < 16384) { return 2; // 14 bits diff --git a/esphome/components/api/proto.h b/esphome/components/api/proto.h index 2ac8dbd844..ec49964035 100644 --- a/esphome/components/api/proto.h +++ b/esphome/components/api/proto.h @@ -524,10 +524,10 @@ class ProtoSize { return 4; return 5; } - return varint_slow_(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)); + static uint32_t varint_slow(uint32_t value) __attribute__((noinline)); /** * @brief Calculates the size in bytes needed to encode a uint64_t value as a varint