Ejemplo n.º 1
0
 /// <summary>
 ///     Returns an equality comparer for sequences, determining equality sequentially.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="eq">Optionally, an equality comparer for the elements. Otherwise, the default equality comparer is used.</param>
 /// <returns></returns>
 public static IEqualityComparer <IEnumerable <T> > SequenceEquality <T>(IEqualityComparer <T> eq = null)
 {
     return(CreateEqComparer <IEnumerable <T> >((x, y) => EqualityHelper.SeqEquals(x, y, eq),
                                                x => EqualityHelper.SeqHashCode(x, eq)));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Computes a hash code for a sequence.
 /// </summary>
 /// <typeparam name="T">The type of value.</typeparam>
 /// <param name="self">The sequence for which to compute the hash code.</param>
 /// <param name="eq">The equality comparer used to generate the hash of each element. If not specified, default equality comparer is used.</param>
 /// <returns></returns>
 public static int CompuateSeqHashCode <T>(this IEnumerable <T> self, IEqualityComparer <T> eq = null)
 {
     return(EqualityHelper.SeqHashCode(self, eq));
 }