Change from map function to use event API#32
Merged
SukkaW merged 3 commits intohexojs:masterfrom Jan 4, 2020
Merged
Conversation
Member
|
Haven't tested yet, but the code change LGTM. |
Contributor
|
@segayuu Do you want to close this since it will not work after |
Contributor
Author
|
Well, I'll close it once and create it again after marging the class refactor. |
6180ccd to
b08c852
Compare
…factoring-JSONparse
b08c852 to
31726c8
Compare
SukkaW
approved these changes
Jan 3, 2020
Member
SukkaW
left a comment
There was a problem hiding this comment.
The changes LGTM. I might setup a benchmark to see if event API has any potential performance boost.
SukkaW
approved these changes
Jan 4, 2020
Member
SukkaW
left a comment
There was a problem hiding this comment.
Has been tested with a dummy Hexo site, it works fine.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By switching to the
dataevent handler (and header, footer), unnecessary branching is reduced.In addition, the second argument of
JSONStream.parse()is a map for processing all data, it is not suitable as a place to consume.