I was working on a legacy framework using HashTables. My colleague suggested to rather use Dictionaries (since they are serializable). I then stumbles over this article explaining how using KeyValuePair is faster than using the regular Keys in a foreach loop. Read more here
Here's an example:
foreach (KeyValuePairpair in d)
{
Console.WriteLine(pair.Key + ", " + pair.Value.ToString());
}
No comments:
Post a Comment