E
essamce
Guest
hi
i want to implement a method like Distinct() in LINQ,
public static void Unique<T>(ref IEnumerable<T> list, Func<T,T, bool> comparer)
{
for (int i = 0; i < list.Count(); i++)
{
for (int j = i + 1; j < list.Count(); j++)
{
if (comparer(list, list[j])) //error
{
list.RemoveAt(j); // error
j--;
}
};
};
}
Continue reading...
i want to implement a method like Distinct() in LINQ,
public static void Unique<T>(ref IEnumerable<T> list, Func<T,T, bool> comparer)
{
for (int i = 0; i < list.Count(); i++)
{
for (int j = i + 1; j < list.Count(); j++)
{
if (comparer(list, list[j])) //error
{
list.RemoveAt(j); // error
j--;
}
};
};
}
Continue reading...