Replaced JsonToken operators by meaningful methods

This commit is contained in:
Benoit Blanchon
2014-07-18 15:54:49 +02:00
parent 4a1d8483cc
commit 714a37bd59
6 changed files with 18 additions and 17 deletions

View File

@ -24,14 +24,14 @@ JsonValue JsonArray::operator[](int index)
return JsonValue::null();
// skip first token, it's the whole object
JsonToken currentToken = token + 1;
JsonToken runningToken = token.firstChild();
// skip all tokens before the specified index
for (int i = 0; i < index; i++)
{
// move forward: current + nested tokens
currentToken += 1 + currentToken.nestedTokenCount();
runningToken = runningToken.nextSibling();
}
return JsonValue(json, currentToken);
return JsonValue(json, runningToken);
}