Circular data & cross references #110#148
Merged
dervus merged 1 commit intonodeca:masterfrom Oct 8, 2014
Merged
Conversation
Collaborator
There was a problem hiding this comment.
Why do you duplicate this code across all of the writers? Can it be placed in writeNode function?
Collaborator
|
In conclusion, please merge all these commits together. |
Collaborator
There was a problem hiding this comment.
Oh, by the way, if you swap the operands here, it'll be great.
Author
|
Sorry about the small remainders, should have seen them. Anyway, here you go. |
Member
|
@loamhoof squash to single commit please. See 'git rebase --interactive' in google |
Catch circular and cross references. The object is first scanned to get these references before starting the writing algorithm. Aliases are then added during it.
Author
|
@puzrin sorry about that, it's done. |
dervus
added a commit
that referenced
this pull request
Oct 8, 2014
Circular data & cross references #110
Collaborator
|
Perfect! Thank you for contribution! |
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.
Adding an option (checkDuplicates) to catch circular and cross
references, disabled by default so as not to slow down any existing code (only a few bits of code are still executed when the option is disabled).
Implemented following @puzrin suggestion that is: do a first pass to get the duplicates, and then put the aliases inside the algorithm. Slower than @larkox 's implementation, but perhaps easier to maintain.
Also added a related test.
NB: There may be some unused aliases if a duplicate is found inside a custom type, which must be a pretty rare case.