public override int GetHashCode() { unchecked { var hashCode = Years.GetHashCode(); hashCode = (hashCode * 397) ^ Months.GetHashCode(); hashCode = (hashCode * 397) ^ Weeks.GetHashCode(); hashCode = (hashCode * 397) ^ Days.GetHashCode(); hashCode = (hashCode * 397) ^ Hours.GetHashCode(); hashCode = (hashCode * 397) ^ Minutes.GetHashCode(); hashCode = (hashCode * 397) ^ Seconds.GetHashCode(); hashCode = (hashCode * 397) ^ Milliseconds.GetHashCode(); return(hashCode); } }
/// <summary> /// Returns the hash code for this instance. /// </summary> /// <returns>A 32-bit signed integer that is the hash code for this instance.</returns> public override int GetHashCode() { unchecked { int hash = (int)2166136261; hash = (hash * 16777619) ^ Years.GetHashCode(); hash = (hash * 16777619) ^ Months.GetHashCode(); hash = (hash * 16777619) ^ Weeks.GetHashCode(); hash = (hash * 16777619) ^ Days.GetHashCode(); hash = (hash * 16777619) ^ Hours.GetHashCode(); hash = (hash * 16777619) ^ Minutes.GetHashCode(); hash = (hash * 16777619) ^ Seconds.GetHashCode(); return(hash); } }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) hashCode = hashCode * 59 + Years.GetHashCode(); hashCode = hashCode * 59 + Months.GetHashCode(); hashCode = hashCode * 59 + Days.GetHashCode(); hashCode = hashCode * 59 + Hours.GetHashCode(); hashCode = hashCode * 59 + Minutes.GetHashCode(); hashCode = hashCode * 59 + Milliseconds.GetHashCode(); hashCode = hashCode * 59 + TotalYears.GetHashCode(); hashCode = hashCode * 59 + TotalMonths.GetHashCode(); hashCode = hashCode * 59 + TotalDays.GetHashCode(); hashCode = hashCode * 59 + TotalHours.GetHashCode(); hashCode = hashCode * 59 + TotalMinutes.GetHashCode(); hashCode = hashCode * 59 + TotalSeconds.GetHashCode(); hashCode = hashCode * 59 + TotalMilliseconds.GetHashCode(); hashCode = hashCode * 59 + Ticks.GetHashCode(); return(hashCode); } }
/// <inheritdoc /> public override int GetHashCode() { return(Months.GetHashCode() ^ Years.GetHashCode() ^ TimeSpan.GetHashCode()); }
/// <summary> /// Provides a hash code for this object. /// </summary> /// <returns>The hash code.</returns> public override int GetHashCode() { return(_totalDays.GetHashCode() ^ Years.GetHashCode() ^ Months.GetHashCode() ^ Weeks.GetHashCode() ^ Days.GetHashCode()); }
/// <inheritdoc /> public override int GetHashCode() { // ReSharper disable NonReadonlyMemberInGetHashCode return(Months.GetHashCode() ^ Years.GetHashCode() ^ TimeSpan.GetHashCode()); }
public override int GetHashCode() => Months.GetHashCode() ^ Years.GetHashCode() ^ TimeSpan.GetHashCode();