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); }
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); }