mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
There are a couple instances where the ByteBuffer's Span property was accessed in a loop. + Extracted the use of the property outside of the loop to save a few cpu cycles. Access to the allocator's internal buffer isn't exposed as a ReadOnlySpan<byte> from the ByteBuffer or the FlatBufferBuilder. + Added a few convenience functions to access the buffer using a ReadOnlySpan<byte>. There are a few cases where built in Span extensions can be used to run optimized code. + Added the use of Span.Fill() and ReadOnlySpan.SequenceCompareTo to replace existing loops. Co-authored-by: Björn Harrtell <bjornharrtell@users.noreply.github.com> Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>