Maybe I’m just missing something, but the HashSet(Of T) class has as TrimExcess method, but no publicly accessible way of finding out the current capacity of an instance. Is there some way I’m being too dense to find?
Maybe I’m just missing something, but the HashSet(Of T) class has as TrimExcess method,
Share
It looks like the capacity can be gotten from the length of the private member m_buckets. You can view its value during Debug. To access private members during runtime you can use either Reflection or dynamics in .NET 4.0.