Skip to content

Commit cb129d0

Browse files
committed
Mark ByteArrayReader members as readonly.
1 parent 01c3bae commit cb129d0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/MySqlConnector/Protocol/Serialization/ByteArrayReader.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public ByteArrayReader(ReadOnlySpan<byte> buffer)
1515

1616
public int Offset
1717
{
18-
get => m_offset;
18+
readonly get => m_offset;
1919
set => m_offset = value >= 0 && value <= m_maxOffset ? value : throw new ArgumentOutOfRangeException(nameof(value), "value must be between 0 and {0}".FormatInvariant(m_maxOffset));
2020
}
2121

@@ -152,9 +152,9 @@ public ReadOnlySpan<byte> ReadLengthEncodedByteString()
152152
return result;
153153
}
154154

155-
public int BytesRemaining => m_maxOffset - m_offset;
155+
public readonly int BytesRemaining => m_maxOffset - m_offset;
156156

157-
private void VerifyRead(int length)
157+
private readonly void VerifyRead(int length)
158158
{
159159
if (m_offset + length > m_maxOffset)
160160
throw new InvalidOperationException("Read past end of buffer.");

0 commit comments

Comments
 (0)