@@ -143,7 +143,7 @@ private static Status VerifyKey(
143143 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
144144 private static Status VerifyValue ( ReadOnlySpan < byte > buffer , ref int offset )
145145 {
146- if ( ValueSize > buffer . Length || offset > buffer . Length - ValueSize )
146+ if ( ValueHeaderSize > buffer . Length || offset > buffer . Length - ValueHeaderSize )
147147 {
148148 _logger . LogError ( "VALUE OUT OF BOUNDS" ) ;
149149 return Status . ValueOutOfBounds ;
@@ -156,7 +156,7 @@ private static Status VerifyValue(ReadOnlySpan<byte> buffer, ref int offset)
156156 return Status . ValueKindInvalid ;
157157 }
158158
159- var valueEntrySize = ValueSize + ValueKindSizes [ ( int ) kind ] ;
159+ var valueEntrySize = ValueHeaderSize + ValueKindSizes [ ( int ) kind ] ;
160160 if ( valueEntrySize > buffer . Length || offset > buffer . Length - valueEntrySize )
161161 {
162162 _logger . LogError ( "VALUE OUT OF BOUNDS" ) ;
@@ -167,7 +167,7 @@ private static Status VerifyValue(ReadOnlySpan<byte> buffer, ref int offset)
167167 {
168168 var byteCount = 0 ;
169169 for ( var i = 0 ; i < ValueKindSizes [ ( int ) ValueKind . Bytes ] ; i ++ )
170- byteCount |= buffer [ offset + ValueSize + i ] << ( 8 * i ) ;
170+ byteCount |= buffer [ offset + ValueHeaderSize + i ] << ( 8 * i ) ;
171171
172172 valueEntrySize += byteCount ;
173173
@@ -614,7 +614,7 @@ public static Status InitializeArray(Span<byte> buffer, out int position)
614614 /// <para>
615615 /// <b>Note</b>: this function expects the caller to write to:
616616 /// <list type="number">
617- /// <item><see cref="ValueEntry.Type" />: the value type (length of <see cref="ValueSize " />).</item>
617+ /// <item><see cref="ValueEntry.Type" />: the value type (length of <see cref="ValueHeaderSize " />).</item>
618618 /// <item><see cref="ValueEntry.Value" />: the actual value (length of <see cref="valueLength" />).</item>
619619 /// </list>
620620 /// </para>
@@ -656,7 +656,7 @@ private static Status SetImpl(
656656 ( ( keyData . Size >> ( 16 - KeyTagKeySizeShift ) != 0 ? 1 : 0 ) << 1 ) +
657657 ( keyData . Size >> ( 8 - KeyTagKeySizeShift ) != 0 ? 1 : 0 ) +
658658 ( keyData . Size != 0 ? 1 : 0 ) ;
659- var baseEntrySize = keyTagSize + ( int ) keyData . Size + ValueSize + valueLength ;
659+ var baseEntrySize = keyTagSize + ( int ) keyData . Size + ValueHeaderSize + valueLength ;
660660
661661 if ( ( offset & NodeAlignmentMask ) != 0 )
662662 {
@@ -958,7 +958,7 @@ private static Status SetImpl(
958958
959959 valueStartOffset = position ;
960960 value = new ValueEntry ( buffer , position ) ;
961- position += ValueSize + valueLength ;
961+ position += ValueHeaderSize + valueLength ;
962962
963963 _logger . LogProbe ( "OK" ) ;
964964 return 0 ;
0 commit comments