Beispiel #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (YoungerPerson != null ? YoungerPerson.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (OlderPerson != null ? OlderPerson.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Difference.GetHashCode();
         return(hashCode);
     }
 }
Beispiel #2
0
 public override int GetHashCode()
 {
     // We need to return the same hash code for Pair(x,y) and Pair(y, x)
     return(YoungerPerson.GetHashCode() + OlderPerson.GetHashCode());
 }