public override int GetHashCode() { if (name == null) { return(0 ^ foodGroup.GetHashCode()); } return(name.GetHashCode() ^ foodGroup.GetHashCode()); }
public override int GetHashCode() { // Microsoft has already implemented GetHasCode() // for standard .NET types return(_name.GetHashCode() ^ _group.GetHashCode()); // ^ is XOR (exclusive OR) }
public override int GetHashCode() { return(_name.GetHashCode() ^ _group.GetHashCode()); }
public override int GetHashCode() => _name.GetHashCode() ^ _group.GetHashCode();
public override int GetHashCode() { return(_name.GetHashCode() ^ _group.GetHashCode()); //^ - Exclusive OR operator }
public override int GetHashCode() { return(_name.GetHashCode() ^ _group.GetHashCode());// GetHashCode already impled for .NET types }
//Returns a 32-bit hash of the value of the object //Hash tables require that if x.Equals(y) then we must have //x.GetHashCode() == y.GetHashCode() public override int GetHashCode() { //using exclusive Or operator XOR return(name.GetHashCode() ^ group.GetHashCode()); }
public override int GetHashCode() // if Equals is overridden, GetHashCod must also be overridden for // dictionaries (and anything else that uses hashes) to work properly { return(_name.GetHashCode() ^ _group.GetHashCode()); }