dotnet/runtime
Prefer Dictionary.Remove(key, out value) over Dictionary.this[key], followed by Dictionary.Remove(key)
开放
#33,800 创建于 2020年3月19日
api-approvedarea-System.Collectionscode-analyzercode-fixerenhancementhelp wanted
仓库指标
- 星标
- (17,886 个星标)
- PR 合并指标
- (平均合并 12天 11小时) (30 天内合并 661 个 PR)
描述
Dictionary.ContainsKey<K, V(key), followed by Dictionary<K, V.this[key], followed by Dictionary<K, V>.Remove(key) can be combined into a single Remove call, using the overload accepting out TValue value.
Category: Performance