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

Fix type equality checks and improve unmarshaling #5

Merged
merged 3 commits into from
Nov 27, 2020
Merged

Conversation

jazg
Copy link
Member

@jazg jazg commented Nov 27, 2020

Previously the type comparison inside the List constructor was just checking if the two Type interfaces were equal. This was unreliable (e.g. when comparing two typeStruct types), and as a result the Type interface has been updated to contain an Equals function. Additionally, concrete unmarshalers have been implemented for the types to ensure the data being unmarshaled is actually valid.

@jazg jazg requested a review from loongy November 27, 2020 01:15
loongy
loongy previously approved these changes Nov 27, 2020
Copy link
Contributor

@loongy loongy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid implementation all round; and it is great to see some new tests added to the test suite. I have approved, but, I have also left some comments for dramatically improving equality checking performance (from O(n) to O(1)).

type.go Outdated Show resolved Hide resolved
type.go Outdated Show resolved Hide resolved
@jazg jazg merged commit 1c8d218 into master Nov 27, 2020
@jazg jazg deleted the fix/type-equality branch November 27, 2020 04:52
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.

2 participants