mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-29 10:17:39 +02:00
Remove CollectionIterator::nextId_
This commit is contained in:
@ -59,10 +59,11 @@ class CollectionIterator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CollectionIterator(VariantData* slot, SlotId slotId);
|
CollectionIterator(VariantData* slot, SlotId slotId)
|
||||||
|
: slot_(slot), currentId_(slotId) {}
|
||||||
|
|
||||||
VariantData* slot_;
|
VariantData* slot_;
|
||||||
SlotId currentId_, nextId_;
|
SlotId currentId_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CollectionData {
|
class CollectionData {
|
||||||
|
@ -12,17 +12,11 @@
|
|||||||
|
|
||||||
ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE
|
ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE
|
||||||
|
|
||||||
inline CollectionIterator::CollectionIterator(VariantData* slot, SlotId slotId)
|
|
||||||
: slot_(slot), currentId_(slotId) {
|
|
||||||
nextId_ = slot_ ? slot_->next() : NULL_SLOT;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void CollectionIterator::next(const ResourceManager* resources) {
|
inline void CollectionIterator::next(const ResourceManager* resources) {
|
||||||
ARDUINOJSON_ASSERT(currentId_ != NULL_SLOT);
|
ARDUINOJSON_ASSERT(slot_);
|
||||||
slot_ = resources->getVariant(nextId_);
|
auto nextId = slot_->next();
|
||||||
currentId_ = nextId_;
|
slot_ = resources->getVariant(nextId);
|
||||||
if (slot_)
|
currentId_ = nextId;
|
||||||
nextId_ = slot_->next();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline CollectionData::iterator CollectionData::createIterator(
|
inline CollectionData::iterator CollectionData::createIterator(
|
||||||
@ -104,9 +98,9 @@ inline void CollectionData::removePair(ObjectData::iterator it,
|
|||||||
if (it.done())
|
if (it.done())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto keySlot = it.slot_;
|
auto keySlot = it.data();
|
||||||
|
|
||||||
auto valueId = it.nextId_;
|
auto valueId = keySlot->next();
|
||||||
auto valueSlot = resources->getVariant(valueId);
|
auto valueSlot = resources->getVariant(valueId);
|
||||||
|
|
||||||
// remove value slot
|
// remove value slot
|
||||||
|
Reference in New Issue
Block a user