Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

BufferWriter.WriteLine String/Utf8String #2176

Merged
merged 3 commits into from
Mar 22, 2018

Conversation

KrzysztofCwalina
Copy link
Member

Added WriteLine to BufferWriter
Refactored and renamed some files.

@KrzysztofCwalina KrzysztofCwalina merged commit f5eb04e into dotnet:master Mar 22, 2018
@@ -19,6 +19,8 @@ public BufferWriter(T output)
_span = output.GetSpan();
}

public ReadOnlySpan<byte> NewLine;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Public field?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I copied/pasted it from the non-generic writer. It should be a property. I will change.

public void Write(int value, StandardFormat format = default)
{
int written;
while (!Utf8Formatter.TryFormat(value, Buffer, out written, format))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for myself. Why don't you use out variables? Is it because of the coding style?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean why don't I do "out int written"? If yes, then because of scoping. I need written outside of the while loop.

Copy link
Contributor

@YohDeadfall YohDeadfall Mar 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks. Didn't know the expression variable scoping is different for loops.

@KrzysztofCwalina KrzysztofCwalina deleted the RW branch March 22, 2018 17:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants