mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-29 18:27:37 +02:00
Stop using CollectionIterator
in MsgPackSerializer
This doesn't reduce code size or stack usage, but as least it's consistent with `JsonSerializer`.
This commit is contained in:
@ -59,10 +59,14 @@ class MsgPackSerializer : public VariantDataVisitor<size_t> {
|
||||
writeByte(0xDD);
|
||||
writeInteger(uint32_t(n));
|
||||
}
|
||||
for (auto it = array.createIterator(resources_); !it.done();
|
||||
it.next(resources_)) {
|
||||
it->accept(*this);
|
||||
|
||||
auto slotId = array.head();
|
||||
while (slotId != NULL_SLOT) {
|
||||
auto slot = resources_->getSlot(slotId);
|
||||
slot->data()->accept(*this);
|
||||
slotId = slot->next();
|
||||
}
|
||||
|
||||
return bytesWritten();
|
||||
}
|
||||
|
||||
@ -77,11 +81,15 @@ class MsgPackSerializer : public VariantDataVisitor<size_t> {
|
||||
writeByte(0xDF);
|
||||
writeInteger(uint32_t(n));
|
||||
}
|
||||
for (auto it = object.createIterator(resources_); !it.done();
|
||||
it.next(resources_)) {
|
||||
visit(it.key());
|
||||
it->accept(*this);
|
||||
|
||||
auto slotId = object.head();
|
||||
while (slotId != NULL_SLOT) {
|
||||
auto slot = resources_->getSlot(slotId);
|
||||
visit(slot->key());
|
||||
slot->data()->accept(*this);
|
||||
slotId = slot->next();
|
||||
}
|
||||
|
||||
return bytesWritten();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user