예제 #1
0
        /// <summary>
        /// Determines value equality.
        /// </summary>
        /// <param name="other">The other object to compare against.</param>
        /// <returns>True if the objects are equal.</returns>
        protected virtual bool IsEqual(DefaultPath <V, E> other)
        {
            bool result = Src.Equals(other.Src) &&
                          Dst.Equals(other.Dst) &&
                          edges.SequenceEqual(other.edges) &&
                          // TODO: This is clunky, is there a better way?
                          (other.Cost?.Equals(Cost) ?? Cost is null);

            return(result);
        }
예제 #2
0
 /// <inheritdoc/>
 public bool Equals(DefaultPath <V, E> other)
 {
     if (other is null)
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(IsEqual(other));
 }