aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common/Extensions/CollectionExtensions.cs
blob: f7c0e3cf04278cf6f33ea5de746ac2e9010ca3e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
using System.Collections.Generic;

namespace MediaBrowser.Common.Extensions
{
    // The MS CollectionExtensions are only available in netcoreapp
    public static class CollectionExtensions
    {
        public static TValue GetValueOrDefault<TKey, TValue> (this IReadOnlyDictionary<TKey, TValue> dictionary, TKey key)
        {
            dictionary.TryGetValue(key, out var ret);
            return ret;
        }
    }
}