heres a tricky question on IDictionary.Contains method
i am making new Hashtable() objects all the time in my project.
however i am making them like so :
IDictionary id = new Hashtable();
my question is in regards to both the .Contains() method in IDictionary and the.ContainsKey() method in hashtable.
according to msdn on .ContainsKey() method:
This method behaves exactly as Contains.
This method is an O(1) operation.
which potentially means that it is faster.
what i want to know is if i use the .Contains() method will it use the underlining .ContainsKey method and therefore i will get O(1) operation? and can u prove this either way.
Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.