예제 #1
0
파일: Edge.cs 프로젝트: pavkam/abacaxi
        /// <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>
        public override int GetHashCode()
        {
            var hashCode = 17;

            hashCode = hashCode * 23 + ToVertex.GetHashCode();
            hashCode = hashCode * 23 + FromVertex.GetHashCode();
            hashCode = hashCode * 23 + Weight.GetHashCode();

            return(hashCode);
        }
예제 #2
0
 public override int GetHashCode()
 {
     return(FromVertex.GetHashCode() ^ FromEndpoint.GetHashCode() ^ ToVertex.GetHashCode() ^ ToEndpoint.GetHashCode());
 }