Skip to content

Conversation

@marschall
Copy link
Contributor

Optimize the following methods in JsonStructureParser

  • skipObject
  • skipArray

Optimize the following methods in JsonStructureParser

- skipObject
- skipArray
@marschall
Copy link
Contributor Author

While the PR may look suspicious I believe the code is correct. The key insight is we are already working on a parsed JsonStructure, we just need to abort iterating on the current subtree. To stop iterating over the current subtree we do not need to advance the iterator to the end, we just need to pop the scope stack. To do this it is enough to set the current state to END_. #next() will then call #transition() which will pop the scope stack because the current state is END_.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant