8000 Fix double call to `size()` in `serializeMsgPack()` · smartcoder00/ArduinoJson@afbcc21 · GitHub
[go: up one dir, main page]

Skip to content

Commit afbcc21

Browse files
committed
Fix double call to size() in serializeMsgPack()
1 parent 7b1c012 commit afbcc21

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ HEAD
66

77
* Fix compatibility with the Blynk libary (issue #1914)
88
* Fix double lookup in `to<JsonVariant>()`
9+
* Fix double call to `size()` in `serializeMsgPack()`
910

1011
v6.21.2 (2023-04-12)
1112
-------

src/ArduinoJson/MsgPack/MsgPackSerializer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class MsgPackSerializer : public Visitor<size_t> {
4747
size_t visitArray(const CollectionData& array) {
4848
size_t n = array.size();
4949
if (n < 0x10) {
50-
writeByte(uint8_t(0x90 + array.size()));
50+
writeByte(uint8_t(0x90 + n));
5151
} else if (n < 0x10000) {
5252
writeByte(0xDC);
5353
writeInteger(uint16_t(n));

0 commit comments

Comments
 (0)
0