Skip to content

Commit 706bdf2

Browse files
committed
Modify TryGetPropertyValue to use its overload with the index param
1 parent 61d7856 commit 706bdf2

File tree

1 file changed

+1
-9
lines changed
  • src/libraries/System.Text.Json/src/System/Text/Json/Nodes

1 file changed

+1
-9
lines changed

src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonObject.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,7 @@ internal string GetPropertyName(JsonNode? node)
121121
/// <returns>
122122
/// <see langword="true"/> if a property with the specified name was found; otherwise, <see langword="false"/>.
123123
/// </returns>
124-
public bool TryGetPropertyValue(string propertyName, out JsonNode? jsonNode)
125-
{
126-
if (propertyName is null)
127-
{
128-
ThrowHelper.ThrowArgumentNullException(nameof(propertyName));
129-
}
130-
131-
return Dictionary.TryGetValue(propertyName, out jsonNode);
132-
}
124+
public bool TryGetPropertyValue(string propertyName, out JsonNode? jsonNode) => TryGetPropertyValue(propertyName, out jsonNode, out _);
133125

134126
/// <summary>
135127
/// Gets the value associated with the specified property name.

0 commit comments

Comments
 (0)