Skip to content

Commit 150eb26

Browse files
committed
Fix CA1853: Unnecessary call to 'Dictionary.ContainsKey(key)'
1 parent eb05856 commit 150eb26

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/JsonApiDotNetCore.OpenApi.Client.NSwag/JsonApiClient.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,8 @@ public void RegisterDocument(object document, AlwaysIncludedAttributes alwaysInc
147147

148148
public void UnRegisterDocument(object document)
149149
{
150-
if (_alwaysIncludedAttributesByDocument.ContainsKey(document))
150+
if (_alwaysIncludedAttributesByDocument.Remove(document))
151151
{
152-
_alwaysIncludedAttributesByDocument.Remove(document);
153-
154152
Type documentType = document.GetType();
155153
_documentsByType[documentType].Remove(document);
156154

0 commit comments

Comments
 (0)