Query module UseTryGetValue

name
Inefficient use of ContainsKey
description
Testing whether a dictionary contains a value before getting it is inefficient and redundant. Use ‘TryGetValue’ to combine these two steps.
kind
problem
problem.severity
recommendation
precision
high
id
cs/inefficient-containskey
tag
maintainability efficiency

Imports

StructuralComparison

Provides functionality for performing structural comparison of expressions and statements.

csharp

The default C# QL library.

Classes

Aliases

G

Provides classes for working with guarded expressions.