Skip to content

Commit

Permalink
Put back some 'var's that were replaced with explicit types.
Browse files Browse the repository at this point in the history
  • Loading branch information
ByronMayne committed Mar 26, 2024
1 parent 74fff81 commit ee376f9
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/LEGO.AsyncAPI/Writers/AsyncApiYamlWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public AsyncApiYamlWriter(TextWriter textWriter, AsyncApiWriterSettings settings
/// </summary>
public override void WriteStartObject()
{
Scope previousScope = this.CurrentScope();
var previousScope = this.CurrentScope();

Scope currentScope = this.StartScope(ScopeType.Object);
var currentScope = this.StartScope(ScopeType.Object);

if (previousScope != null && previousScope.Type == ScopeType.Array)
{
Expand All @@ -87,10 +87,10 @@ public override void WriteStartObject()
/// </summary>
public override void WriteEndObject()
{
Scope previousScope = this.EndScope(ScopeType.Object);
var previousScope = this.EndScope(ScopeType.Object);
this.DecreaseIndentation();

Scope currentScope = this.CurrentScope();
var currentScope = this.CurrentScope();

// If the object is empty, indicate it by writing { }
if (previousScope.ObjectCount == 0)
Expand All @@ -110,9 +110,9 @@ public override void WriteEndObject()
/// </summary>
public override void WriteStartArray()
{
Scope previousScope = this.CurrentScope();
var previousScope = this.CurrentScope();

Scope currentScope = this.StartScope(ScopeType.Array);
var currentScope = this.StartScope(ScopeType.Array);

if (previousScope != null && previousScope.Type == ScopeType.Array)
{
Expand All @@ -133,10 +133,10 @@ public override void WriteStartArray()
/// </summary>
public override void WriteEndArray()
{
Scope previousScope = this.EndScope(ScopeType.Array);
var previousScope = this.EndScope(ScopeType.Array);
this.DecreaseIndentation();

Scope currentScope = this.CurrentScope();
var currentScope = this.CurrentScope();

// If the array is empty, indicate it by writing [ ]
if (previousScope.ObjectCount == 0)
Expand All @@ -158,7 +158,7 @@ public override void WritePropertyName(string name)
{
this.VerifyCanWritePropertyName(name);

Scope currentScope = this.CurrentScope();
var currentScope = this.CurrentScope();

// If this is NOT the first property in the object, always start a new line and add indentation.
if (currentScope.ObjectCount != 0)
Expand Down Expand Up @@ -249,13 +249,13 @@ public override void WriteValue(string value)

private void WriteChompingIndicator(string value)
{
int trailingNewlines = 0;
int end = value.Length - 1;
var trailingNewlines = 0;
var end = value.Length - 1;

// We only need to know whether there are 0, 1, or more trailing newlines
while (end >= 0 && trailingNewlines < 2)
{
int found = value.LastIndexOfAny(new[] { '\n', '\r' }, end, 2);
var found = value.LastIndexOfAny(new[] { '\n', '\r' }, end, 2);
if (found == -1 || found != end)
{
// does not ends with newline
Expand Down

0 comments on commit ee376f9

Please sign in to comment.