Exemplo n.º 1
0
        public override int GetHashCode(GraphEdge <TValue, TDirection> obj)
        {
            if (ReferenceEquals(obj, null))
            {
                return(0);
            }

            // Combine the high and low words of the direction and target hash codes.
            return(DirectionEqualityComparer.GetHashCode(obj.Direction) << 16 | GraphNodeEqualityComparer.GetHashCode(obj.Target) >> 16);
        }
Exemplo n.º 2
0
        public override bool Equals(GraphEdge <TValue, TDirection> x, GraphEdge <TValue, TDirection> y)
        {
            if (ReferenceEquals(x, y))
            {
                return(true);
            }

            if (ReferenceEquals(x, null) || ReferenceEquals(y, null))
            {
                return(false);
            }

            return(DirectionEqualityComparer.Equals(x.Direction, y.Direction) &&
                   GraphNodeEqualityComparer.Equals(x.Target, y.Target));
        }