I just noticed the HashTable objects have a Contains and CotainsKey method, with same description. So are they just synonyms or is there som edifference behind the scenes
If you examine the code of Contains with reflector, you can see that it directly call ContainsKey.
The IL is:
.method public hidebysig newslot virtual instance bool Contains(object key) cil managed
{
.maxstack 8
L_0000: ldarg.0
L_0001: ldarg.1
L_0002: callvirt instance bool System.Collections.Hashtable::ContainsKey(object)
L_0007: ret
}
This translates to the following C#
public virtual bool Contains(object key)
{
return this.ContainsKey(key);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With