diff --git a/CHANGELOG.md b/CHANGELOG.md index 06661a37..a6b71ade 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,3 +16,4 @@ HEAD * Always store `serialized("string")` by copy (#1915) * Remove the zero-copy mode of `deserializeJson()` and `deserializeMsgPack()` * Fix double lookup in `to()` +* Fix double call to `size()` in `serializeMsgPack()` \ No newline at end of file diff --git a/src/ArduinoJson/MsgPack/MsgPackSerializer.hpp b/src/ArduinoJson/MsgPack/MsgPackSerializer.hpp index 0b727ee8..374d3172 100644 --- a/src/ArduinoJson/MsgPack/MsgPackSerializer.hpp +++ b/src/ArduinoJson/MsgPack/MsgPackSerializer.hpp @@ -47,7 +47,7 @@ class MsgPackSerializer : public Visitor { size_t visitArray(const ArrayData& array) { size_t n = array.size(); if (n < 0x10) { - writeByte(uint8_t(0x90 + array.size())); + writeByte(uint8_t(0x90 + n)); } else if (n < 0x10000) { writeByte(0xDC); writeInteger(uint16_t(n));