Upraviť

Zdieľať cez


SortedSet<T>.IntersectWith(IEnumerable<T>) Method

Definition

Modifies the current SortedSet<T> object so that it contains only elements that are also in a specified collection.

public:
 virtual void IntersectWith(System::Collections::Generic::IEnumerable<T> ^ other);
public virtual void IntersectWith (System.Collections.Generic.IEnumerable<T> other);
abstract member IntersectWith : seq<'T> -> unit
override this.IntersectWith : seq<'T> -> unit
Public Overridable Sub IntersectWith (other As IEnumerable(Of T))

Parameters

other
IEnumerable<T>

The collection to compare to the current SortedSet<T> object.

Implements

Exceptions

other is null.

Remarks

This method ignores any duplicate elements in other.

If the collection represented by the other parameter is a SortedSet<T> collection with the same equality comparer as the current SortedSet<T> object, this method is an O(n) operation. Otherwise, this method is an O(n + m) operation, where n is Count and m is the number of elements in other.

Applies to