Add .NET Standard 2.0 target to ComputeSharp
Also switch TerraFX.Interop.Windows to shared project
このコミットが含まれているのは:
1 親
78f68f7b8c
コミット
06ce524740
66ファイル変更
+1276
-178
検索条件に一致するファイルはありません
@@ -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;
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする