fix: Fixes span reader ReadString (#1539)

This commit is contained in:
Kamron Batman 2023-10-11 13:41:24 -07:00 committed by GitHub
parent 0018901a79
commit 1ebaf5390d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 4 deletions

View file

@ -277,6 +277,7 @@ public static class StringHelpers
_ => buffer.IndexOf((byte)0)
};
// TODO: If returns -1, do not multiply by the byte length
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int IndexOfTerminator(this ReadOnlySpan<byte> buffer, int sizeT) =>
sizeT switch