Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize skip methods of JsonStructureParser #141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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