HashSet<T>.EnsureCapacity(Int32) HashSet<T>.EnsureCapacity(Int32) HashSet<T>.EnsureCapacity(Int32) HashSet<T>.EnsureCapacity(Int32) Method

定义

确保此哈希集无需增大即可容纳指定数量的元素。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

参数

capacity
Int32 Int32 Int32 Int32

要确保的最小容量。The minimum capacity to ensure.

返回

此实例的新容量。The new capacity of this instance.

异常

适用于