public override int GetHashCode() { unchecked // overflow is fine, just wrap { var hash = 17; // suitable nullity checks etc, of course :) hash = hash * 23 + IsPrimitive.GetHashCode(); hash = hash * 23 + IsArray.GetHashCode(); hash = hash * 23 + Properties.GetHashCode(); return(hash); } }
public override int GetHashCode() { if (!_hashComputed) { _hashCode = ((DefinedInAssemblyIdentity?.ToString() ?? string.Empty) + (MemberDocId ?? string.Empty) + IsPrimitive.ToString((IFormatProvider)CultureInfo.InvariantCulture)).GetHashCode() ^ CallingAssembly.GetHashCode(); _hashComputed = true; } return(_hashCode); }
public override int GetHashCode() { if (!_hashComputed) { _hashCode = ((DefinedInAssemblyIdentity?.ToString() ?? string.Empty) + (MemberDocId ?? string.Empty) + IsPrimitive.ToString()).GetHashCode() ^ CallingAssembly.GetHashCode(); _hashComputed = true; } return(_hashCode); }