From 999339b208313e732dc72c11389eaf1a14301cbb Mon Sep 17 00:00:00 2001 From: Wills Ward Date: Fri, 14 Nov 2025 09:41:35 -0600 Subject: [PATCH] do not allocate new buffer if the current buffer is sufficient --- src/Orleans.Serialization/Buffers/Writer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Orleans.Serialization/Buffers/Writer.cs b/src/Orleans.Serialization/Buffers/Writer.cs index e82b418d01e..9a17a9259b3 100644 --- a/src/Orleans.Serialization/Buffers/Writer.cs +++ b/src/Orleans.Serialization/Buffers/Writer.cs @@ -222,7 +222,7 @@ public void Commit() public void EnsureContiguous(int length) { // The current buffer is adequate. - if (_bufferPos + length < _currentSpan.Length) + if (_bufferPos + length <= _currentSpan.Length) { return; }