예제 #1
0
 public void Clear()
 {
     curr   = default(T);
     next   = null;
     _count = 0;
     GC.Collect();//垃圾回收,回收没有引用的next.next及next.next.next....
 }
예제 #2
0
 public MIList(params T[] t)
 {
     if (t.Length == 0)
     {
         _count = 0;
     }
     else
     {
         _count = t.Length;
         curr   = t[0];
         if (t.Length > 1)
         {
             T[] tsub = new T[t.Length - 1];
             for (var i = 0; i < tsub.Length; i++)
             {
                 tsub[i] = t[i + 1];
             }
             next = new MIList <T>(tsub);
         }
     }
 }