Edit

Share via


OrderedDictionary<TKey,TValue>.TrimExcess Method

Definition

Overloads

TrimExcess(Int32)

Sets the capacity of this dictionary to hold up a specified number of entries without resizing.

TrimExcess()

Sets the capacity of this dictionary to what it would be if it had been originally initialized with all its entries.

TrimExcess(Int32)

Sets the capacity of this dictionary to hold up a specified number of entries without resizing.

public:
 void TrimExcess(int capacity);
public void TrimExcess (int capacity);
member this.TrimExcess : int -> unit
Public Sub TrimExcess (capacity As Integer)

Parameters

capacity
Int32

The desired capacity to which to shrink the dictionary.

Exceptions

capacity is less than Count.

Applies to

TrimExcess()

Sets the capacity of this dictionary to what it would be if it had been originally initialized with all its entries.

public:
 void TrimExcess();
public void TrimExcess ();
member this.TrimExcess : unit -> unit
Public Sub TrimExcess ()

Applies to