| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. |
| 2 | |
| 3 | namespace WixToolset.Data |
| 4 | { |
| 5 | using System.Collections.Generic; |
| 6 | |
| 7 | internal static class DictionaryExtensions |
| 8 | { |
| 9 | public static V GetValueOrDefault<K, V>(this IDictionary<K, V> dictionary, K key, V defaultValue = default(V)) |
| 10 | { |
| 11 | return dictionary.TryGetValue(key, out var value) ? value : defaultValue; |
| 12 | } |
| 13 | } |
| 14 | } |