0243デフォルトの名無しさん (アウアウエー Sadf-HQem)
2017/12/26(火) 22:15:00.14ID:Nu277XVhapublic static class Extensions
{
public static void CopyTo<T>(this IList<T> src, IList<T> dst)
{
int count = Math.Min(src.Count, dst.Count);
for (int i = 0; i < count; i++)
dst[i] = src[i];
}
public static void Sort<T, TKey>(this IList<T> x, Func<T, TKey> keySelector)
{
x.OrderBy(keySelector).ToList().CopyTo(x);
}
}