When to use a HashTable

后端 未结 8 958
眼角桃花
眼角桃花 2020-12-24 02:13

In C#, I find myself using a List, IList or IEnumerable 99% of the time. Is there a case when it would be b

8条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-24 02:51

    Hashtable optimizes lookups. It computes a hash of each key you add. It then uses this hash code to look up the element very quickly. It is an older .NET Framework type. It is slower than the generic Dictionary type.

提交回复
热议问题