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

Prefer RuntimeHelpers.Equals before notifying #137

Open
JohanLarsson opened this issue Aug 22, 2019 · 3 comments
Open

Prefer RuntimeHelpers.Equals before notifying #137

JohanLarsson opened this issue Aug 22, 2019 · 3 comments

Comments

@JohanLarsson
Copy link
Collaborator

https://docs.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.runtimehelpers.equals?view=netframework-4.8
Does it box for value types or does it get special IL? /cc @jnm2

@jnm2
Copy link
Collaborator

jnm2 commented Aug 22, 2019

It does box. Unfortunately, there's no way to tell whether EqualityComparer<T>.Default.Equals would behave the same as RuntimeHelpers.Equals.

@jnm2
Copy link
Collaborator

jnm2 commented Aug 22, 2019

I don't expect that to be a problem in the apps I'm thinking of. But if we want to come up with one pattern to rule them all, maybe it's best to set unconditionally and use EqualityComparer<T>.Default.Equals to determine whether to raise PropertyChanged?

@JohanLarsson
Copy link
Collaborator Author

We can make it configurable via multiple IDs. Not the most ergonomic way but it is either that of write something to editorconfig.

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

No branches or pull requests

2 participants