mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 17:05:36 +00:00
bot review
This commit is contained in:
@@ -56,15 +56,6 @@ template<typename K, typename V> class Mapping {
|
||||
char buf[32]; // enough for %g with doubles
|
||||
buf_append_printf(buf, sizeof(buf), 0, "%g", static_cast<double>(key));
|
||||
esph_log_e(TAG, "Key '%s' not found in mapping", buf);
|
||||
} else if constexpr (std::is_enum_v<K>) {
|
||||
using underlying_t = std::underlying_type_t<K>;
|
||||
char buf[24]; // enough for underlying integral type
|
||||
if constexpr (std::is_unsigned_v<underlying_t>) {
|
||||
buf_append_printf(buf, sizeof(buf), 0, "%" PRIu64, static_cast<uint64_t>(static_cast<underlying_t>(key)));
|
||||
} else {
|
||||
buf_append_printf(buf, sizeof(buf), 0, "%" PRId64, static_cast<int64_t>(static_cast<underlying_t>(key)));
|
||||
}
|
||||
esph_log_e(TAG, "Key '%s' not found in mapping", buf);
|
||||
} else {
|
||||
// All supported key types are handled above - this should never be reached
|
||||
static_assert(sizeof(K) == 0, "Unsupported key type for Mapping error logging");
|
||||
|
||||
Reference in New Issue
Block a user