-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathListExtension.cs
28 lines (27 loc) · 974 Bytes
/
ListExtension.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//---------------------------------------------------------------------------------------------------------------------------
// <copyright file="ListExtension.cs">(c) Mike Fourie. All other rights reserved.</copyright>
//---------------------------------------------------------------------------------------------------------------------------
namespace MSBuildExplorer
{
using System;
using System.Collections;
public static class ListExtension
{
public static void BubbleSort(this IList o)
{
for (int i = o.Count - 1; i >= 0; i--)
{
for (int j = 1; j <= i; j++)
{
object o1 = o[j - 1];
object o2 = o[j];
if (((IComparable)o1).CompareTo(o2) > 0)
{
o.Remove(o1);
o.Insert(j, o1);
}
}
}
}
}
}