1
This commit is contained in:
@@ -152,20 +152,11 @@ namespace BITKit
|
||||
list.Remove(t);
|
||||
return list.ToArray();
|
||||
}
|
||||
public static bool TryRemove<TKey, TValue>(this IDictionary<TKey, TValue> self, TKey t)
|
||||
{
|
||||
return self.ContainsKey(t) && self.Remove(t);
|
||||
}
|
||||
|
||||
public static bool TryRemove<TKey, TValue>(this IDictionary<TKey, TValue> self, TKey t) => self.Remove(t);
|
||||
public static void Set<TKey, TValue>(this IDictionary<TKey, TValue> self, TKey key, TValue value)
|
||||
{
|
||||
if (self.ContainsKey(key))
|
||||
{
|
||||
self[key] = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
self.Add(key, value);
|
||||
}
|
||||
self[key] = value;
|
||||
}
|
||||
public static TValue Get<TKey,TValue>(this IDictionary<Type,TValue> self)
|
||||
{
|
||||
|
Reference in New Issue
Block a user