From 98553e1163f0dd7b86245c1fc2b567fe106e661a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 11 Jan 2026 10:37:19 +0000 Subject: [PATCH 1/2] Initial plan From 13ed6827d0d80f7ca338739005b840a6b245db61 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 11 Jan 2026 10:40:37 +0000 Subject: [PATCH 2/2] Make LengthPrefixedBlock fields readonly using primary constructor Co-authored-by: lukaskabrt <2894161+lukaskabrt@users.noreply.github.com> --- src/PbfLite/PbfBlockWriter.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/PbfLite/PbfBlockWriter.cs b/src/PbfLite/PbfBlockWriter.cs index 78628ac..4bc70ef 100644 --- a/src/PbfLite/PbfBlockWriter.cs +++ b/src/PbfLite/PbfBlockWriter.cs @@ -163,11 +163,7 @@ public LengthPrefixedBlock StartLengthPrefixedBlock(int estimatedBlockLength) var contentPosition = lengthPosition + GetVarIntBytesCount((uint)estimatedBlockLength); _position = contentPosition; - return new LengthPrefixedBlock - { - LengthPosition = lengthPosition, - ContentPosition = contentPosition - }; + return new LengthPrefixedBlock(lengthPosition, contentPosition); } /// @@ -195,7 +191,4 @@ public void FinalizeLengthPrefixedBlock(LengthPrefixedBlock block) } } -public record struct LengthPrefixedBlock { - public int LengthPosition; - public int ContentPosition; -} \ No newline at end of file +public record struct LengthPrefixedBlock(int LengthPosition, int ContentPosition); \ No newline at end of file