Merged nestedTokenCount() and nextSibling()

This commit is contained in:
Benoit Blanchon
2014-07-18 16:18:03 +02:00
parent 5d2ffc49fd
commit 79953730fc
4 changed files with 14 additions and 12 deletions

View File

@ -3,19 +3,17 @@
using namespace ArduinoJson::Internal;
int JsonToken::nestedTokenCount() const
JsonToken JsonToken::nextSibling() const
{
jsmntok_t* t = token;
int yetToVisit = t->size;
int count = 0;
while (yetToVisit)
{
count++;
t++;
yetToVisit--;
yetToVisit += t->size;
}
return count;
return t + 1;
}