Teach LambdaEqualityHelper to deal with null equality contribution#541
Conversation
|
@ethomson I'd indeed prefer not to make FWIW, I found a clear case in LibGit2Sharp which demonstrates this issue. [Fact]
public void CanRetrieveHashCodeFromAnUnbornBranch()
{
string path = InitNewRepository();
using (var repo = new Repository(path))
{
Assert.DoesNotThrow(() => repo.Head.GetHashCode());
}
} |
There was a problem hiding this comment.
Rather than using 0 (which would level down the previous computation steps to 1), how about using a bit larger number (eg. The Java 31 or whatever...)
|
I don't think I'm following entirely; should XORing with zero versus one change the distribution significantly? Note that Joshua Bloch's |
|
Duh. Ignore me. I don't know why, but I forgot that |
|
I brought in @dahlbyk 's tests. This is one of the few times I wish for java's package protection...! |
We could achieve a similar effect with InternalsVisibleTo, though that feels like cheating. |
|
Squashed, rebased, etc. |
|
Very nice catch! ❤️ to both of you. |
No description provided.