Skip to content

Commit

Permalink
update based on review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ElizabethOkerio committed Feb 8, 2024
1 parent 90fb1c2 commit ff70c38
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Microsoft.OData.Core/Json/ODataUtf8JsonWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ internal sealed class ODataUtf8JsonWriter : IJsonWriter, IDisposable, IJsonWrite
/// <summary>
/// Rrepresents a read-only memory block containing the byte representation of the double quote character (").
/// </summary>
private readonly static ReadOnlyMemory<byte> _doubleQuote = new byte[] { (byte)'"' };
private readonly ReadOnlyMemory<byte> DoubleQuote = new byte[] { (byte)'"' };

/// <summary>
/// Creates an instance of <see cref="ODataUtf8JsonWriter"/>.
Expand Down Expand Up @@ -415,7 +415,7 @@ private void WriteStringValueInChunks(ReadOnlySpan<char> value)

WriteItemWithSeparatorIfNeeded();

this.bufferWriter.Write(_doubleQuote.Slice(0, 1).Span);
this.bufferWriter.Write(this.DoubleQuote.Slice(0, 1).Span);

this.Flush();

Expand Down Expand Up @@ -443,7 +443,7 @@ private void WriteStringValueInChunks(ReadOnlySpan<char> value)
this.FlushIfBufferThresholdReached();
}

this.bufferWriter.Write(_doubleQuote.Slice(0, 1).Span);
this.bufferWriter.Write(this.DoubleQuote.Slice(0, 1).Span);

// since we bypass the Utf8JsonWriter, we need to signal to other
// Write methods that a separator should be written first
Expand Down Expand Up @@ -593,7 +593,7 @@ private void WriteByteValueInChunks(ReadOnlySpan<byte> value)

WriteItemWithSeparatorIfNeeded();

this.bufferWriter.Write(_doubleQuote.Slice(0, 1).Span);
this.bufferWriter.Write(this.DoubleQuote.Slice(0, 1).Span);

this.Flush();

Expand All @@ -611,7 +611,7 @@ private void WriteByteValueInChunks(ReadOnlySpan<byte> value)
this.FlushIfBufferThresholdReached();
}

this.bufferWriter.Write(_doubleQuote.Slice(0, 1).Span);
this.bufferWriter.Write(this.DoubleQuote.Slice(0, 1).Span);

// since we bypass the Utf8JsonWriter, we need to signal to other
// Write methods that a separator should be written first
Expand Down Expand Up @@ -1100,7 +1100,7 @@ private async ValueTask WriteStringValueInChunksAsync(ReadOnlyMemory<char> value

WriteItemWithSeparatorIfNeeded();

this.bufferWriter.Write(_doubleQuote.Slice(0, 1).Span);
this.bufferWriter.Write(this.DoubleQuote.Slice(0, 1).Span);

await this.FlushAsync();

Expand Down Expand Up @@ -1129,7 +1129,7 @@ private async ValueTask WriteStringValueInChunksAsync(ReadOnlyMemory<char> value
await this.FlushIfBufferThresholdReachedAsync();
}

this.bufferWriter.Write(_doubleQuote.Slice(0, 1).Span);
this.bufferWriter.Write(this.DoubleQuote.Slice(0, 1).Span);

// since we bypass the Utf8JsonWriter, we need to signal to other
// Write methods that a separator should be written first
Expand Down Expand Up @@ -1168,7 +1168,7 @@ private async ValueTask WriteByteValueInChunksAsync(ReadOnlyMemory<byte> value)

WriteItemWithSeparatorIfNeeded();

this.bufferWriter.Write(_doubleQuote.Slice(0, 1).Span);
this.bufferWriter.Write(this.DoubleQuote.Slice(0, 1).Span);

await FlushAsync().ConfigureAwait(false);

Expand All @@ -1186,7 +1186,7 @@ private async ValueTask WriteByteValueInChunksAsync(ReadOnlyMemory<byte> value)
await FlushIfBufferThresholdReachedAsync().ConfigureAwait(false);
}

this.bufferWriter.Write(_doubleQuote.Slice(0, 1).Span);
this.bufferWriter.Write(this.DoubleQuote.Slice(0, 1).Span);

// since we bypass the Utf8JsonWriter, we need to signal to other
// Write methods that a separator should be written first
Expand Down

0 comments on commit ff70c38

Please sign in to comment.