Exemple #1
0
 public bool AddIfNotContains(object key)
 {
     if (key == null)
     {
         return(false);
     }
     RbTree.InsertResult result = this._tree.Insert(key, false, false);
     if (result.NewNode)
     {
         this._count++;
     }
     return(result.NewNode);
 }
Exemple #2
0
 public bool Add(object key)
 {
     if (key == null)
     {
         return(false);
     }
     RbTree.InsertResult result = this._tree.Insert(key, this._allowDuplicates, true);
     if (result.NewNode)
     {
         this._count++;
     }
     return(result.NewNode);
 }