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

#309: static Equals not used #310

Merged
merged 3 commits into from
Apr 4, 2018
Merged

#309: static Equals not used #310

merged 3 commits into from
Apr 4, 2018

Conversation

jhartmann123
Copy link
Contributor

@jhartmann123 jhartmann123 commented Jan 9, 2018

Fixes #309

@SimonCropp
Copy link
Member

happy to accept this as a change but not in its current form. walking up the hierarchy for every type is not ideal https://github.com/Fody/PropertyChanged/pull/310/files#diff-0475c87a808e41b1f849062b31c9a3d3R85

this type of information should be stored in TypeNode https://github.com/Fody/PropertyChanged/blob/master/PropertyChanged.Fody/TypeNode.cs on a single pass then used on all classes when injecting

@jhartmann123
Copy link
Contributor Author

jhartmann123 commented Mar 22, 2018

I couldn't really use TypeNode, as those are only created for the types defined in the assembly that gets currently weaved. As I obviously also need the equality comparers for properties with types defined in other assemblies, that's a small show stopper.

Instead I'm filling the (already existing) method cache a bit more aggressivly, so the type hierarchy only has to be run down once.

Example:

class A : B{}
class B : C{}
class C {
   static bool Equals(...)
}

When looking for the static equals on A, after the method was found on C, the cache gets filled with a reference to the method for all three types A, B and C.

I hope that's a bit better :)

@jhartmann123
Copy link
Contributor Author

jhartmann123 commented Mar 30, 2018

Sorry, sometimes I'm an idiot and can't see the easiest solutions...

Equality info gets stored in the PropertyData now - I can move it up to TypeNode if you want to. Either way - it gets loaded in one pass while filling the TypeNodes now.

@SimonCropp SimonCropp merged commit 165bf03 into Fody:master Apr 4, 2018
@SimonCropp SimonCropp added this to the 2.4.0 milestone Apr 4, 2018
@SimonCropp
Copy link
Member

thanks. this is now deployed. although nuget might take a few hours to update its index

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

Successfully merging this pull request may close these issues.

static Equals not used
2 participants