playMaker

Author Topic: [SOLVED] HashTable - ContainsKey vs. Contains  (Read 2860 times)

Jos Yule

  • Playmaker Newbie
  • *
  • Posts: 33
    • View Profile
[SOLVED] HashTable - ContainsKey vs. Contains
« on: May 17, 2012, 08:32:53 AM »
Hello!

Looking at the code, the two only differ in the following method call

HashTableContains.cs:

Code: [Select]
containsKey.Value = proxy.hashTable.Contains(key.Value);
HashTableContainsKey.cs:

Code: [Select]
containsKey.Value = proxy.hashTable.ContainsKey(key.Value);
I can't find .Contains() on the msdn site, but .ContainsKey() is here: http://msdn.microsoft.com/en-us/library/kw5aaea4

What is the difference between the two?

Looking at the assembly browser version, .ContainsKey() actually just calls the .Contains() method under the hood, I think. In which case, can we remove one? I'd suggest the .Contains(), as it isn't in the msdn docs...

Thanks!
Jos
« Last Edit: May 21, 2012, 12:44:16 PM by Alex Chouls »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15060
  • Official Playmaker Support
    • View Profile
Re: HashTable - ContainsKey vs. Contains
« Reply #1 on: May 17, 2012, 04:39:40 PM »
HI,

 I remember that, but forgot why I left both versions...

http://msdn.microsoft.com/en-us/library/system.collections.hashtable.contains.aspx

I'll remove contains from future packages.

 thanks for spotting!

 Jean

Jos Yule

  • Playmaker Newbie
  • *
  • Posts: 33
    • View Profile
[SOLVED] Re: HashTable - ContainsKey vs. Contains
« Reply #2 on: May 21, 2012, 12:16:53 PM »
Cool, thanks!

j