Add .NET Standard 2.0 target to ComputeSharp

Also switch TerraFX.Interop.Windows to shared project
このコミットが含まれているのは:
Sergio Pedri committed 2021-11-16 17:34:01 +01:00
1 親 78f68f7b8c
コミット 06ce524740
66ファイル変更
+1276 -178

検索条件に一致するファイルはありません

+28
ファイルの表示
@@ -0,0 +1,28 @@
namespace System.Collections.Generic;
/// <summary>
/// A helper type with extensions for the <see cref="Dictionary{TKey, TValue}"/> type.
/// </summary>
internal static class DictionaryExtensions
{
/// <summary>
/// Tries to remove an item from a <see cref="Dictionary{TKey, TValue}"/> instance and returns it if present.
/// </summary>
/// <typeparam name="TKey">The type of dictionary keys.</typeparam>
/// <typeparam name="TValue">The type of dictionary values.</typeparam>
/// <param name="dictionary">The input <see cref="Dictionary{TKey, TValue}"/> instance.</param>
/// <param name="key">The lookup key to use.</param>
/// <param name="value">The resulting item, if present.</param>
/// <returns>Whether or not an item was found with the given key.</returns>
public static bool Remove<TKey, TValue>(this Dictionary<TKey, TValue> dictionary, TKey key, out TValue value)
{
if (dictionary.TryGetValue(key, out value))
{
_ = dictionary.Remove(key);
return true;
}
return false;
}
}