Refactored getNestedTokenCount()

This commit is contained in:
Benoit Blanchon
2014-02-27 13:32:50 +01:00
parent a35d503a02
commit 3661f801a5

View File

@ -10,12 +10,14 @@
int JsonObjectBase::getNestedTokenCount(jsmntok_t* token) int JsonObjectBase::getNestedTokenCount(jsmntok_t* token)
{ {
int end = token->end;
int count = 0; int count = 0;
jsmntok_t* nextSibling = token + 1;
while (nextSibling->start < token->end) token++;
while (token->start < end)
{ {
nextSibling++; token++;
count++; count++;
} }