Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Jos Yule on May 17, 2012, 11:32:53 AM

Title: [SOLVED] HashTable - ContainsKey vs. Contains
Post by: Jos Yule on May 17, 2012, 11: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 (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
Title: Re: HashTable - ContainsKey vs. Contains
Post by: jeanfabre on May 17, 2012, 07: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 (http://msdn.microsoft.com/en-us/library/system.collections.hashtable.contains.aspx)

I'll remove contains from future packages.

 thanks for spotting!

 Jean
Title: [SOLVED] Re: HashTable - ContainsKey vs. Contains
Post by: Jos Yule on May 21, 2012, 03:16:53 PM
Cool, thanks!

j