mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-30 18:57:32 +02:00
Use CollectionIterator
in CollectionData::nesting()
This commit is contained in:
@ -84,8 +84,8 @@ inline size_t CollectionData::memoryUsage() const {
|
|||||||
|
|
||||||
inline size_t CollectionData::nesting() const {
|
inline size_t CollectionData::nesting() const {
|
||||||
size_t maxChildNesting = 0;
|
size_t maxChildNesting = 0;
|
||||||
for (const VariantSlot* s = head_; s; s = s->next()) {
|
for (auto it = createIterator(); !it.done(); it.next()) {
|
||||||
size_t childNesting = s->data()->nesting();
|
size_t childNesting = it->nesting();
|
||||||
if (childNesting > maxChildNesting)
|
if (childNesting > maxChildNesting)
|
||||||
maxChildNesting = childNesting;
|
maxChildNesting = childNesting;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user