Skip to content

Commit de79734

Browse files
authored
Merge pull request #1419 from SimonCropp/remove-redundant-type-specs
remove redundant type specs
2 parents 7ca9730 + 9350562 commit de79734

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

src/Microsoft.OpenApi.Hidi/Extensions/StringExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static IList<string> SplitByChar(this string target, char separator)
4040
{
4141
return new List<string>();
4242
}
43-
return target.Split(new char[] { separator }, StringSplitOptions.RemoveEmptyEntries).ToList();
43+
return target.Split(new[] { separator }, StringSplitOptions.RemoveEmptyEntries).ToList();
4444
}
4545
}
4646
}

src/Microsoft.OpenApi/Any/OpenApiByte.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class OpenApiByte : OpenApiPrimitive<byte[]>
1212
/// Initializes the <see cref="OpenApiByte"/> class.
1313
/// </summary>
1414
public OpenApiByte(byte value)
15-
: this(new byte[] { value })
15+
: this(new[] { value })
1616
{
1717
}
1818

test/Microsoft.OpenApi.Hidi.Tests/Services/OpenApiServiceTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ public void InvokeTransformCommand()
322322
{
323323
var rootCommand = Program.CreateRootCommand();
324324
var openapi = Path.Combine(".", "UtilityFiles", "SampleOpenApi.yml");
325-
var args = new string[] { "transform", "-d", openapi, "-o", "sample.json", "--co" };
325+
var args = new[] { "transform", "-d", openapi, "-o", "sample.json", "--co" };
326326
var parseResult = rootCommand.Parse(args);
327327
var handler = rootCommand.Subcommands.Where(c => c.Name == "transform").First().Handler;
328328
var context = new InvocationContext(parseResult);
@@ -339,7 +339,7 @@ public void InvokeShowCommand()
339339
{
340340
var rootCommand = Program.CreateRootCommand();
341341
var openApi = Path.Combine(".", "UtilityFiles", "SampleOpenApi.yml");
342-
var args = new string[] { "show", "-d", openApi, "-o", "sample.md" };
342+
var args = new[] { "show", "-d", openApi, "-o", "sample.md" };
343343
var parseResult = rootCommand.Parse(args);
344344
var handler = rootCommand.Subcommands.Where(c => c.Name == "show").First().Handler;
345345
var context = new InvocationContext(parseResult);
@@ -355,7 +355,7 @@ public void InvokePluginCommand()
355355
{
356356
var rootCommand = Program.CreateRootCommand();
357357
var manifest = Path.Combine(".", "UtilityFiles", "exampleapimanifest.json");
358-
var args = new string[] { "plugin", "-m", manifest, "--of", AppDomain.CurrentDomain.BaseDirectory };
358+
var args = new[] { "plugin", "-m", manifest, "--of", AppDomain.CurrentDomain.BaseDirectory };
359359
var parseResult = rootCommand.Parse(args);
360360
var handler = rootCommand.Subcommands.Where(c => c.Name == "plugin").First().Handler;
361361
var context = new InvocationContext(parseResult);

test/Microsoft.OpenApi.Tests/Writers/OpenApiJsonWriterTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ public class OpenApiJsonWriterTests
2222
public static IEnumerable<object[]> WriteStringListAsJsonShouldMatchExpectedTestCases()
2323
{
2424
return
25-
from input in new string[][] {
25+
from input in new[]
26+
{
2627
new[]
2728
{
2829
"string1",
@@ -234,7 +235,7 @@ public void WriteMapAsJsonShouldMatchExpected(IDictionary<string, object> inputM
234235
public static IEnumerable<object[]> WriteDateTimeAsJsonTestCases()
235236
{
236237
return
237-
from input in new DateTimeOffset[] {
238+
from input in new[] {
238239
new(2018, 1, 1, 10, 20, 30, TimeSpan.Zero),
239240
new(2018, 1, 1, 10, 20, 30, 100, TimeSpan.FromHours(14)),
240241
DateTimeOffset.UtcNow + TimeSpan.FromDays(4),

test/Microsoft.OpenApi.Tests/Writers/OpenApiWriterAnyExtensionsTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static IEnumerable<object[]> IntInputs
4040
get
4141
{
4242
return
43-
from input in new int[] {
43+
from input in new[] {
4444
int.MinValue,
4545
42,
4646
int.MaxValue,
@@ -68,7 +68,7 @@ public static IEnumerable<object[]> LongInputs
6868
get
6969
{
7070
return
71-
from input in new long[] {
71+
from input in new[] {
7272
long.MinValue,
7373
42,
7474
long.MaxValue,
@@ -96,7 +96,7 @@ public static IEnumerable<object[]> FloatInputs
9696
get
9797
{
9898
return
99-
from input in new float[] {
99+
from input in new[] {
100100
float.MinValue,
101101
42.42f,
102102
float.MaxValue,
@@ -124,7 +124,7 @@ public static IEnumerable<object[]> DoubleInputs
124124
get
125125
{
126126
return
127-
from input in new double[] {
127+
from input in new[] {
128128
double.MinValue,
129129
42.42d,
130130
double.MaxValue,

0 commit comments

Comments
 (0)