3 ms·
In the dictionary case, TryGetValue also saves you from having to hash and lookup twice unnecessarily (once for ContainsKey, and once for GetValue).
by ygra 5y ago
In the dictionary case, TryGetValue also saves you from having to hash and lookup twice unnecessarily (once for ContainsKey, and once for GetValue).