msgpack-arduino icon indicating copy to clipboard operation
msgpack-arduino copied to clipboard

Implicit functions question

Open Sod-Almighty opened this issue 5 years ago • 2 comments

Hi, and thanks for making this library available.

I notice that writeMapSize(Stream&, const uint8_t) checks if the value exceeds 1 << 4, and if not, encodes it as a map4 value.

However, I note that the other writeMapSize overloads (uint16_t and uint32_t) don't perform this check. Why is this? Surely if the value can fit in a map4, then it should be encoded as such? Wouldn't that be more space-efficient?

Sod-Almighty avatar Nov 13 '18 10:11 Sod-Almighty