mirror of
https://github.com/esphome/esphome.git
synced 2025-07-31 07:36:35 +00:00
unused
This commit is contained in:
parent
72fd984d4b
commit
7f25d3e6d3
@ -672,20 +672,6 @@ class ProtoSize {
|
|||||||
// NOTE: sint64 support functions (add_sint64_field, add_sint64_field_repeated) removed
|
// NOTE: sint64 support functions (add_sint64_field, add_sint64_field_repeated) removed
|
||||||
// sint64 type is not supported by ESPHome API to reduce overhead on embedded systems
|
// sint64 type is not supported by ESPHome API to reduce overhead on embedded systems
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Calculates and adds the size of a string/bytes field to the total message size
|
|
||||||
*/
|
|
||||||
static inline void add_string_field(uint32_t &total_size, uint32_t field_id_size, const std::string &str) {
|
|
||||||
// Skip calculation if string is empty
|
|
||||||
if (str.empty()) {
|
|
||||||
return; // No need to update total_size
|
|
||||||
}
|
|
||||||
|
|
||||||
// Calculate and directly add to total_size
|
|
||||||
const uint32_t str_size = static_cast<uint32_t>(str.size());
|
|
||||||
total_size += field_id_size + varint(str_size) + str_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Calculates and adds the size of a string field using length
|
* @brief Calculates and adds the size of a string field using length
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user