mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	remove dead code
This commit is contained in:
		| @@ -487,35 +487,6 @@ class ProtoSize { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * @brief Calculates the size in bytes needed to encode a uint64_t value as a varint | ||||
|    * | ||||
|    * @param value The uint64_t value to calculate size for | ||||
|    * @return The number of bytes needed to encode the value | ||||
|    */ | ||||
|   static constexpr uint32_t varint(uint64_t value) { | ||||
|     // Handle common case of values fitting in uint32_t (vast majority of use cases) | ||||
|     if (value <= UINT32_MAX) { | ||||
|       return varint(static_cast<uint32_t>(value)); | ||||
|     } | ||||
|  | ||||
|     // For larger values, use simple ladder (constexpr-friendly) | ||||
|     // Note: encode_varint_raw uses CLZ for runtime performance, but this is rarely called | ||||
|     if (value < (1ULL << 35)) { | ||||
|       return 5;  // 35 bits | ||||
|     } else if (value < (1ULL << 42)) { | ||||
|       return 6;  // 42 bits | ||||
|     } else if (value < (1ULL << 49)) { | ||||
|       return 7;  // 49 bits | ||||
|     } else if (value < (1ULL << 56)) { | ||||
|       return 8;  // 56 bits | ||||
|     } else if (value < (1ULL << 63)) { | ||||
|       return 9;  // 63 bits | ||||
|     } else { | ||||
|       return 10;  // 64 bits (maximum for uint64_t) | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * @brief Calculates the size in bytes needed to encode an int32_t value as a varint | ||||
|    * | ||||
|   | ||||
		Reference in New Issue
	
	Block a user