HashSet<T>.IntersectWith(IEnumerable<T>) Método

Definición

Modifica el objeto HashSet<T> actual para que solo contenga elementos que están presentes en ese objeto y en la colección especificada.

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

Parámetros

other
IEnumerable<T>

Colección que se va a comparar con el objeto HashSet<T> actual.

Implementaciones

Atributos

Excepciones

other es null.

Comentarios

Si la colección representada por el other parámetro es una HashSet<T> colección con el mismo comparador de igualdad que el objeto actual HashSet<T> , este método es una operación O(n). De lo contrario, este método es una operación O(n + m), donde n es Count y m es el número de elementos de other.

Se aplica a