~ruther/NosTale-Gfless

ref: 1fb9e061a3334d492540fdb4c67dd8b3c5a47dda NosTale-Gfless/NostaleAuth/Extensions/DictionaryExtension.cs -rw-r--r-- 429 bytes
1fb9e061 — František Boháček fix: wait for main nostale window to open 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
using System.Collections.Generic;

namespace NostaleAuth.Extensions
{
    public static class DictionaryExtension
    {
        public static V GetValueOrDefault<K, V>(this IDictionary<K, V> dictionary, K key, V value) => dictionary.TryGetValue(key, out V result) ? result : value;
        public static V GetValueOrDefault<K, V>(this IDictionary<K, V> dictionary, K key) => dictionary.GetValueOrDefault(key, default);
    }
}