19 lines
482 B
C#
19 lines
482 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace Encompass
|
|
{
|
|
internal class SimpleCycleComparer<TNode> : IEqualityComparer<IEnumerable<TNode>>
|
|
{
|
|
public bool Equals(IEnumerable<TNode> x, IEnumerable<TNode> y)
|
|
{
|
|
return x.SequenceEqual(y);
|
|
}
|
|
|
|
public int GetHashCode(IEnumerable<TNode> obj)
|
|
{
|
|
return obj.Aggregate(0, (current, next) => current.GetHashCode() ^ next.GetHashCode());
|
|
}
|
|
}
|
|
}
|