1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-24 22:22:22 +01:00

address lint comment

This commit is contained in:
J. Nick Koston
2025-07-11 14:36:38 -10:00
parent 95786ce269
commit 6f5f378857
3 changed files with 48 additions and 26 deletions

View File

@@ -2200,9 +2200,7 @@ void ExecuteServiceArgument::calculate_size(uint32_t &total_size) const {
}
}
if (!this->float_array.empty()) {
for (const auto &it : this->float_array) {
ProtoSize::add_fixed_field_repeated<4>(total_size, 1);
}
total_size += this->float_array.size() * 5;
}
if (!this->string_array.empty()) {
for (const auto &it : this->string_array) {

View File

@@ -233,18 +233,6 @@ class ProtoSize {
total_size += field_id_size + NumBytes;
}
/**
* @brief Calculates and adds the size of a fixed field to the total message size (repeated field version)
*
* @tparam NumBytes The number of bytes for this fixed field (4 or 8)
*/
template<uint32_t NumBytes>
static inline void add_fixed_field_repeated(uint32_t &total_size, uint32_t field_id_size) {
// Always calculate size for repeated fields
// Fixed fields always take exactly NumBytes
total_size += field_id_size + NumBytes;
}
/**
* @brief Calculates and adds the size of an enum field to the total message size
*