Skip to content

Optimize skip methods of JsonStructureParser#141

Open
marschall wants to merge 1 commit into
eclipse-ee4j:masterfrom
marschall:skipStructure
Open

Optimize skip methods of JsonStructureParser#141
marschall wants to merge 1 commit into
eclipse-ee4j:masterfrom
marschall:skipStructure

Conversation

@marschall

Copy link
Copy Markdown
Contributor

Optimize the following methods in JsonStructureParser

  • skipObject
  • skipArray

Optimize the following methods in JsonStructureParser

- skipObject
- skipArray
@marschall

Copy link
Copy Markdown
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