Skip to content

Commit

Permalink
Merge pull request #1419 from SimonCropp/remove-redundant-type-specs
Browse files Browse the repository at this point in the history
remove redundant type specs
  • Loading branch information
baywet authored Oct 10, 2023
2 parents 7ca9730 + 9350562 commit de79734
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Microsoft.OpenApi.Hidi/Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static IList<string> SplitByChar(this string target, char separator)
{
return new List<string>();
}
return target.Split(new char[] { separator }, StringSplitOptions.RemoveEmptyEntries).ToList();
return target.Split(new[] { separator }, StringSplitOptions.RemoveEmptyEntries).ToList();
}
}
}
2 changes: 1 addition & 1 deletion src/Microsoft.OpenApi/Any/OpenApiByte.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class OpenApiByte : OpenApiPrimitive<byte[]>
/// Initializes the <see cref="OpenApiByte"/> class.
/// </summary>
public OpenApiByte(byte value)
: this(new byte[] { value })
: this(new[] { value })
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public void InvokeTransformCommand()
{
var rootCommand = Program.CreateRootCommand();
var openapi = Path.Combine(".", "UtilityFiles", "SampleOpenApi.yml");
var args = new string[] { "transform", "-d", openapi, "-o", "sample.json", "--co" };
var args = new[] { "transform", "-d", openapi, "-o", "sample.json", "--co" };
var parseResult = rootCommand.Parse(args);
var handler = rootCommand.Subcommands.Where(c => c.Name == "transform").First().Handler;
var context = new InvocationContext(parseResult);
Expand All @@ -339,7 +339,7 @@ public void InvokeShowCommand()
{
var rootCommand = Program.CreateRootCommand();
var openApi = Path.Combine(".", "UtilityFiles", "SampleOpenApi.yml");
var args = new string[] { "show", "-d", openApi, "-o", "sample.md" };
var args = new[] { "show", "-d", openApi, "-o", "sample.md" };
var parseResult = rootCommand.Parse(args);
var handler = rootCommand.Subcommands.Where(c => c.Name == "show").First().Handler;
var context = new InvocationContext(parseResult);
Expand All @@ -355,7 +355,7 @@ public void InvokePluginCommand()
{
var rootCommand = Program.CreateRootCommand();
var manifest = Path.Combine(".", "UtilityFiles", "exampleapimanifest.json");
var args = new string[] { "plugin", "-m", manifest, "--of", AppDomain.CurrentDomain.BaseDirectory };
var args = new[] { "plugin", "-m", manifest, "--of", AppDomain.CurrentDomain.BaseDirectory };
var parseResult = rootCommand.Parse(args);
var handler = rootCommand.Subcommands.Where(c => c.Name == "plugin").First().Handler;
var context = new InvocationContext(parseResult);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public class OpenApiJsonWriterTests
public static IEnumerable<object[]> WriteStringListAsJsonShouldMatchExpectedTestCases()
{
return
from input in new string[][] {
from input in new[]
{
new[]
{
"string1",
Expand Down Expand Up @@ -234,7 +235,7 @@ public void WriteMapAsJsonShouldMatchExpected(IDictionary<string, object> inputM
public static IEnumerable<object[]> WriteDateTimeAsJsonTestCases()
{
return
from input in new DateTimeOffset[] {
from input in new[] {
new(2018, 1, 1, 10, 20, 30, TimeSpan.Zero),
new(2018, 1, 1, 10, 20, 30, 100, TimeSpan.FromHours(14)),
DateTimeOffset.UtcNow + TimeSpan.FromDays(4),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static IEnumerable<object[]> IntInputs
get
{
return
from input in new int[] {
from input in new[] {
int.MinValue,
42,
int.MaxValue,
Expand Down Expand Up @@ -68,7 +68,7 @@ public static IEnumerable<object[]> LongInputs
get
{
return
from input in new long[] {
from input in new[] {
long.MinValue,
42,
long.MaxValue,
Expand Down Expand Up @@ -96,7 +96,7 @@ public static IEnumerable<object[]> FloatInputs
get
{
return
from input in new float[] {
from input in new[] {
float.MinValue,
42.42f,
float.MaxValue,
Expand Down Expand Up @@ -124,7 +124,7 @@ public static IEnumerable<object[]> DoubleInputs
get
{
return
from input in new double[] {
from input in new[] {
double.MinValue,
42.42d,
double.MaxValue,
Expand Down

0 comments on commit de79734

Please sign in to comment.