HashSet<T>.EnsureCapacity(Int32) Method

Definition

Garantisce che questo set di hash possa conservare il numero specificato di elementi senza aumentare.Ensures that this hash set can hold the specified number of elements without growing.

public:
 int EnsureCapacity(int capacity);
public int EnsureCapacity (int capacity);
member this.EnsureCapacity : int -> int
Public Function EnsureCapacity (capacity As Integer) As Integer

Parameters

capacity
Int32

Capacità minima da garantire.The minimum capacity to ensure.

Returns

Int32

Nuova capacità di questa istanza.The new capacity of this instance.

Exceptions

capacity è minore di zero.capacity is less than zero.

Applies to