Skip to content

Commit 6c9da6a

Browse files
committed
use array constructor
1 parent eff033e commit 6c9da6a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/GraphQL/Conversion/IFieldNameConverter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Linq;
33
using GraphQL.Introspection;
44

@@ -11,7 +11,7 @@ public interface IFieldNameConverter
1111

1212
public class DefaultFieldNameConverter : IFieldNameConverter
1313
{
14-
private static readonly Type[] IntrospectionTypes = new[] { typeof(SchemaIntrospection) };
14+
private static readonly Type[] IntrospectionTypes = { typeof(SchemaIntrospection) };
1515

1616
public string NameFor(string field, Type parentType)
1717
{
@@ -39,7 +39,7 @@ public string NameFor(string field, Type parentType)
3939

4040
public class PascalCaseFieldNameConverter : IFieldNameConverter
4141
{
42-
private static readonly Type[] IntrospectionTypes = new[] { typeof(SchemaIntrospection) };
42+
private static readonly Type[] IntrospectionTypes = { typeof(SchemaIntrospection) };
4343

4444
public string NameFor(string field, Type parentType)
4545
{

src/GraphQL/TypeExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ public static Type GetEnumerableElementType(this Type type)
207207
throw new ArgumentOutOfRangeException(nameof(type), $"The element type for {type.Name} cannot be coerced effectively");
208208
}
209209

210-
private static readonly Type[] _untypedContainers = new[] { typeof(IEnumerable), typeof(IList), typeof(ICollection) };
210+
private static readonly Type[] _untypedContainers = { typeof(IEnumerable), typeof(IList), typeof(ICollection) };
211211

212-
private static readonly Type[] _typedContainers = new [] { typeof(IEnumerable<>), typeof(List<>), typeof(IList<>), typeof(ICollection<>), typeof(IReadOnlyCollection<>) };
212+
private static readonly Type[] _typedContainers = { typeof(IEnumerable<>), typeof(List<>), typeof(IList<>), typeof(ICollection<>), typeof(IReadOnlyCollection<>) };
213213
}
214214
}

0 commit comments

Comments
 (0)