/// <summary> /// Returns a hash code for this instance. /// </summary> /// <returns>A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.</returns> /// <autogeneratedoc /> public override int GetHashCode() { unchecked { var hashCode = IPAddress != null?IPAddress.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (SubnetMask != null ? SubnetMask.GetHashCode() : 0); return(hashCode); } }
public override int GetHashCode() { if (_hashCode == null) { unchecked { _hashCode = ((Address?.GetHashCode() ?? 0) * 397) ^ (SubnetMask?.GetHashCode() ?? 0); } } return(_hashCode.Value); }
public override int GetHashCode() { return(2 * BaseAddress.GetHashCode() + 3 * SubnetMask.GetHashCode()); }