Exemple #1
0
 protected bool DoRemove(ref ODBNode <T> node)
 {
     if (!this.any || node.list != this)
     {
         return(false);
     }
     this.hashSet.Remove(node.self);
     node.Dispose();
     node = null;
     return(true);
 }
Exemple #2
0
 protected bool DoRemove(ref ODBNode <T> node)
 {
     if (this.any && (node.list == this))
     {
         this.hashSet.Remove(node.self);
         node.Dispose();
         node = null;
         return(true);
     }
     return(false);
 }
Exemple #3
0
 protected void DoIntersectWith(ODBList <T> list)
 {
     if (this.any)
     {
         if (list.any)
         {
             if (list != this)
             {
                 this.hashSet.IntersectWith(list.hashSet);
                 int count = this.hashSet.Count;
                 if (count == 0)
                 {
                     while (this.any)
                     {
                         this.first.item.Dispose();
                     }
                 }
                 else
                 {
                     ODBSibling <T> first = this.first;
                     do
                     {
                         ODBNode <T> item = first.item;
                         first = first.item.n;
                         if (!this.hashSet.Contains(item.self))
                         {
                             item.Dispose();
                             if (this.count == count)
                             {
                                 break;
                             }
                         }
                     }while (first.has);
                 }
             }
         }
         else
         {
             this.DoClear();
         }
     }
 }
Exemple #4
0
 protected void DoIntersectWith(ODBList <T> list)
 {
     if (this.any)
     {
         if (!list.any)
         {
             this.DoClear();
         }
         else if (list != this)
         {
             this.hashSet.IntersectWith(list.hashSet);
             int count = this.hashSet.Count;
             if (count != 0)
             {
                 ODBSibling <T> oDBSibling = this.first;
                 do
                 {
                     ODBNode <T> oDBNode = oDBSibling.item;
                     oDBSibling = oDBSibling.item.n;
                     if (this.hashSet.Contains(oDBNode.self))
                     {
                         continue;
                     }
                     oDBNode.Dispose();
                     if (this.count != count)
                     {
                         continue;
                     }
                     break;
                 }while (oDBSibling.has);
             }
             else
             {
                 while (this.any)
                 {
                     this.first.item.Dispose();
                 }
             }
         }
     }
 }