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

Add Type.Equal(Type) bool function to compare Cadence types efficiently #2199

Closed
fxamacker opened this issue Dec 16, 2022 · 0 comments · Fixed by #2203
Closed

Add Type.Equal(Type) bool function to compare Cadence types efficiently #2199

fxamacker opened this issue Dec 16, 2022 · 0 comments · Fixed by #2203

Comments

@fxamacker
Copy link
Member

Issue To Be Solved

Checking if cadence.Type are equal is currently done by comparing Type.ID(). It should be possible to provide a more efficient way to do this comparison in Go.

Suggested Solution

One solution is to add Type.Equal(Type) bool function to cadence.Type interface.

During brief chat about this on Slack, @turbolent confirmed we don't currently have a utility function to do this comparison and also mentioned it should be possible to do recursive comparison without allocating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants