Skip to content

Commit c6a3a10

Browse files
chore: Potential fix for code scanning alert no. 2327: Missed ternary opportunity
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 63b2b98 commit c6a3a10

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/Microsoft.OpenApi/Reader/ParseNodes/MapNode.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,9 @@ public PropertyNode? this[string key]
3939
{
4040
if (_node.TryGetPropertyValue(key, out var node))
4141
{
42-
if (node is not null)
43-
return new(Context, key, node);
44-
else
45-
return new(Context, key, JsonNullSentinel.JsonNull);
42+
return node is not null
43+
? new(Context, key, node)
44+
: new(Context, key, JsonNullSentinel.JsonNull);
4645
}
4746

4847
return null;

0 commit comments

Comments
 (0)