AlgorithmsRemoveDuplicatesInPlaceT Method (IListT, BinaryPredicateT) |
Remove consecutive "equal" items from a list or array. In each run of consecutive equal items
in the list, all items after the first item in the run are removed. The replacement is done in-place, changing
the list. The passed BinaryPredicate is used to determine if two items are "equal".
Namespace: X3Platform.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic static void RemoveDuplicatesInPlace<T>(
IList<T> list,
BinaryPredicate<T> predicate
)
public:
generic<typename T>
static void RemoveDuplicatesInPlace(
IList<T>^ list,
BinaryPredicate<T>^ predicate
)
Parameters
- list
- Type: System.Collections.GenericIListT
The list or array to process. - predicate
- Type: X3Platform.CollectionsBinaryPredicateT
The BinaryPredicate used to compare items for "equality".
Type Parameters
- T
[Missing <typeparam name="T"/> documentation for "M:X3Platform.Collections.Algorithms.RemoveDuplicatesInPlace``1(System.Collections.Generic.IList{``0},X3Platform.Collections.BinaryPredicate{``0})"]
RemarksSince an arbitrary BinaryPredicate is passed to this function, what is being tested for need not be true equality.
Although arrays cast to IList<T> are normally read-only, this method
will work correctly and modify an array passed as list.
See Also