/// <summary> /// Returns a hash code for the specified object. /// </summary> /// <param name="obj">The object for which to return a hash code. This object may be <c>null</c>.</param> /// <returns>A hash code for the specified object.</returns> protected override int DoGetHashCode(T obj) { unchecked { var ret = (int)2166136261; ret += ComparerHelpers.GetHashCodeFromComparer(Source, obj); ret *= 16777619; ret += ComparerHelpers.GetHashCodeFromComparer(SecondSource, obj); ret *= 16777619; return(ret); } }
/// <summary> /// Returns a hash code for the specified object. /// </summary> /// <param name="obj">The object for which to return a hash code.</param> /// <returns>A hash code for the specified object.</returns> protected override int DoGetHashCode(IEnumerable <T> obj) { Contract.Assume(obj != null); unchecked { var ret = (int)2166136261; foreach (var item in obj) { ret += ComparerHelpers.GetHashCodeFromComparer(Source, item); ret *= 16777619; } return(ret); } }
/// <summary> /// Returns a hash code for the specified object. /// </summary> /// <param name="obj">The object for which to return a hash code. This object may be <c>null</c>.</param> /// <returns>A hash code for the specified object.</returns> protected override int DoGetHashCode(T obj) { return(ComparerHelpers.GetHashCodeFromComparer(this.Source, obj)); }