Dictionary<K, V>
CS-R1119A dictionary's indexer updates an element if it already exists and adds it if it doesn't. This is an easier and shorter way of adding/updating a key and should be the preferred way.
if (dict.ContainsKey(k, v))
{
dict[k] = v;
}
else
{
dict.Add(k, v);
}
dict[k] = v;