Method Remove
Remove(Node)
Removes the specified node from the list. Does nothing if the node has already been removed.
Declaration
public void Remove(WeakList<T>.Node node)
Parameters
| Type | Name | Description |
|---|---|---|
| WeakList<T>.Node | node |
Remarks
This operation takes O(1) time.
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException |
|
Remove(T, IEqualityComparer<T>?)
Removes the first value in the list that is equal to the specified value.
Declaration
public bool Remove(T value, IEqualityComparer<T>? comparer = null)
Parameters
| Type | Name | Description |
|---|---|---|
| T | value | The value to remove. |
| IEqualityComparer<T> | comparer | The comparer to use to determine equality, or null to use the default comparer. |
Returns
| Type | Description |
|---|---|
| bool |
Remarks
This operation enumerates the list, so it takes O(n) time plus the cost of the comparisons. Nodes added by other threads during the search are not considered.
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | The list has been disposed. |