Skip to content

Commit d1cb002

Browse files
committed
Replace Enumerable methods with indexing
1 parent e93cd4c commit d1cb002

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Microsoft.OpenApi.Hidi/Formatters/PowerShellFormatter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ private void AddAdditionalPropertiesToSchema(ref JsonSchema schema)
205205

206206
private static JsonSchema ResolveOneOfSchema(ref JsonSchema schema)
207207
{
208-
if (schema.GetOneOf()?.FirstOrDefault() is {} newSchema)
208+
if (schema.GetOneOf()?[0] is {} newSchema)
209209
{
210210
var schemaBuilder = BuildSchema(schema);
211211
schemaBuilder = schemaBuilder.Remove("oneOf");
@@ -219,7 +219,7 @@ private static JsonSchema ResolveOneOfSchema(ref JsonSchema schema)
219219

220220
private static JsonSchema ResolveAnyOfSchema(ref JsonSchema schema)
221221
{
222-
if (schema.GetAnyOf()?.FirstOrDefault() is {} newSchema)
222+
if (schema.GetAnyOf()?[0] is {} newSchema)
223223
{
224224
var schemaBuilder = BuildSchema(schema);
225225
schemaBuilder = schemaBuilder.Remove("anyOf");

0 commit comments

Comments
 (0)