Less shitty float to double conversion to avoid compiler warning

This commit is contained in:
2023-10-10 15:03:49 +02:00
parent c65e8b2201
commit 8cbb0975a1

View File

@ -37,7 +37,7 @@ class MsgPackSerializer : public Visitor<size_t> {
ARDUINOJSON_NO_SANITIZE("float-cast-overflow")
typename enable_if<sizeof(T) == 8, size_t>::type visitFloat(T value64) {
float value32 = float(value64);
if (value32 == value64)
if (double(value32) == value64)
return visitFloat(value32);
writeByte(0xCB);
writeInteger(value64);