Use expression body syntax
This commit is contained in:
@@ -32,16 +32,13 @@ namespace OpenRA.Primitives
|
||||
public ConcurrentCache(Func<T, U> loader)
|
||||
: this(loader, EqualityComparer<T>.Default) { }
|
||||
|
||||
public U this[T key]
|
||||
{
|
||||
get { return cache.GetOrAdd(key, loader); }
|
||||
}
|
||||
public U this[T key] => cache.GetOrAdd(key, loader);
|
||||
|
||||
public bool ContainsKey(T key) { return cache.ContainsKey(key); }
|
||||
public bool TryGetValue(T key, out U value) { return cache.TryGetValue(key, out value); }
|
||||
public int Count { get { return cache.Count; } }
|
||||
public ICollection<T> Keys { get { return cache.Keys; } }
|
||||
public ICollection<U> Values { get { return cache.Values; } }
|
||||
public int Count => cache.Count;
|
||||
public ICollection<T> Keys => cache.Keys;
|
||||
public ICollection<U> Values => cache.Values;
|
||||
public IEnumerator<KeyValuePair<T, U>> GetEnumerator() { return cache.GetEnumerator(); }
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return GetEnumerator(); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user