Thanks, I completely missed the lookup method.

Tomas

Am 15.08.2006 um 01:00 schrieb Tomas Camin:

Which is faster?

Exceptions are generally assumed to be expensive. Your second approach will search the dictionary two times.

Sometimes I pass a key that is not contained in the dictionary and I return a default value.

Then you obviously missed this method of the dictonary class, which should be fastest solution:

result = Dictionary.Lookup( key, defaultValue )

Hans-Georg




_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to