Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions source/NetCoreServer/Buffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,10 @@ public long Append(string text)
/// <returns>Count of append bytes</returns>
public long Append(ReadOnlySpan<char> text)
{
int length = Encoding.UTF8.GetMaxByteCount(text.Length);
var encoding = Encoding.UTF8;
var length = encoding.GetMaxByteCount(text.Length);
Reserve(_size + length);
long result = Encoding.UTF8.GetBytes(text, new Span<byte>(_data, (int)_size, length));
var result = encoding.GetBytes(text.ToArray(), 0, text.Length, _data, (int)_size);
_size += result;
return result;
}
Expand Down
Loading