Skip to content

Commit a3b10ed

Browse files
committed
CollectionIterator: rename next() to move()
1 parent 5def9a3 commit a3b10ed

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

src/ArduinoJson/Array/ArrayImpl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ inline VariantImpl::iterator VariantImpl::at(size_t index) const {
1616

1717
auto it = createIterator();
1818
while (!it.done() && index) {
19-
it.next();
19+
it.move();
2020
--index;
2121
}
2222
return it;
@@ -35,7 +35,7 @@ inline VariantData* VariantImpl::addElement() {
3535
inline VariantData* VariantImpl::getOrAddElement(size_t index) {
3636
auto it = createIterator();
3737
while (!it.done() && index > 0) {
38-
it.next();
38+
it.move();
3939
index--;
4040
}
4141
if (it.done())

src/ArduinoJson/Array/JsonArrayIterator.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class JsonArrayIterator {
5050
}
5151

5252
JsonArrayIterator& operator++() {
53-
iterator_.next();
53+
iterator_.move();
5454
return *this;
5555
}
5656

@@ -82,7 +82,7 @@ class JsonArrayConstIterator {
8282
}
8383

8484
JsonArrayConstIterator& operator++() {
85-
iterator_.next();
85+
iterator_.move();
8686
return *this;
8787
}
8888

src/ArduinoJson/Collection/CollectionImpl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ inline size_t VariantImpl::nesting() const {
9898
if (!data_ || !data_->isCollection())
9999
return 0;
100100
size_t maxChildNesting = 0;
101-
for (auto it = createIterator(); !it.done(); it.next()) {
101+
for (auto it = createIterator(); !it.done(); it.move()) {
102102
auto childNesting = it->nesting();
103103
if (childNesting > maxChildNesting)
104104
maxChildNesting = childNesting;
@@ -112,7 +112,7 @@ inline size_t VariantImpl::size() const {
112112

113113
size_t count = 0;
114114

115-
for (auto it = createIterator(); !it.done(); it.next())
115+
for (auto it = createIterator(); !it.done(); it.move())
116116
count++;
117117

118118
if (data_->type == VariantType::Object)

src/ArduinoJson/Collection/CollectionIterator.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class CollectionIterator {
1717
CollectionIterator(SlotId slotId, ResourceManager* resources)
1818
: value_(resources->getVariant(slotId), resources), slotId_(slotId) {}
1919

20-
void next() {
20+
void move() {
2121
ARDUINOJSON_ASSERT(!done());
2222
auto nextId = value_.data()->next;
2323
auto resources = value_.resources();

src/ArduinoJson/Json/PrettyJsonSerializer.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class PrettyJsonSerializer : public JsonSerializer<TWriter> {
2727
while (!it.done()) {
2828
indent();
2929
it->accept(*this);
30-
it.next();
30+
it.move();
3131
base::write(it.done() ? "\r\n" : ",\r\n");
3232
}
3333
nesting_--;
@@ -49,7 +49,7 @@ class PrettyJsonSerializer : public JsonSerializer<TWriter> {
4949
if (isKey)
5050
indent();
5151
it->accept(*this);
52-
it.next();
52+
it.move();
5353
if (isKey)
5454
base::write(": ");
5555
else

src/ArduinoJson/Object/JsonObjectIterator.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class JsonObjectIterator {
3333
}
3434

3535
JsonObjectIterator& operator++() {
36-
iterator_.next(); // key
37-
iterator_.next(); // value
36+
iterator_.move(); // key
37+
iterator_.move(); // value
3838
return *this;
3939
}
4040

@@ -68,8 +68,8 @@ class JsonObjectConstIterator {
6868
}
6969

7070
JsonObjectConstIterator& operator++() {
71-
iterator_.next(); // key
72-
iterator_.next(); // value
71+
iterator_.move(); // key
72+
iterator_.move(); // value
7373
return *this;
7474
}
7575

src/ArduinoJson/Object/JsonPair.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class JsonPair {
1818
JsonPair(detail::VariantImpl::iterator iterator) {
1919
if (!iterator.done()) {
2020
key_ = iterator->asString();
21-
iterator.next();
21+
iterator.move();
2222
value_ = JsonVariant(*iterator);
2323
}
2424
}
@@ -45,7 +45,7 @@ class JsonPairConst {
4545
JsonPairConst(detail::VariantImpl::iterator iterator) {
4646
if (!iterator.done()) {
4747
key_ = iterator->asString();
48-
iterator.next();
48+
iterator.move();
4949
value_ = JsonVariantConst(*iterator);
5050
}
5151
}

src/ArduinoJson/Object/ObjectImpl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ inline VariantData* VariantImpl::getMember(TAdaptedString key) const {
1414
auto it = findKey(key);
1515
if (it.done())
1616
return nullptr;
17-
it.next();
17+
it.move();
1818
return it->data();
1919
}
2020

@@ -33,7 +33,7 @@ inline VariantImpl::iterator VariantImpl::findKey(TAdaptedString key) const {
3333
if (key.isNull())
3434
return iterator();
3535
bool isKey = true;
36-
for (auto it = createIterator(); !it.done(); it.next()) {
36+
for (auto it = createIterator(); !it.done(); it.move()) {
3737
if (isKey && stringEquals(key, adaptString(it->asString())))
3838
return it;
3939
isKey = !isKey;

0 commit comments

Comments
 (0)