mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-27 09:12:17 +00:00
Revert "Performance Increase of Vector of Structures using .NET BlockCopy (#4830)"
This reverts commit 7b50004ec9.
Change-Id: I09d6869c16aa3c7fadc537fc9c76eaa3cf7ee7ea
This commit is contained in:
@@ -94,29 +94,6 @@ namespace FlatBuffers
|
||||
return bb.ToArraySegment(pos, len);
|
||||
}
|
||||
|
||||
// Get the data of a vector whoses offset is stored at "offset" in this object as an
|
||||
// T[]. If the vector is not present in the ByteBuffer, then a null value will be
|
||||
// returned.
|
||||
public T[] __vector_as_array<T>(int offset)
|
||||
where T : struct
|
||||
{
|
||||
if(!BitConverter.IsLittleEndian)
|
||||
{
|
||||
throw new NotSupportedException("Getting typed arrays on a Big Endian " +
|
||||
"system is not support");
|
||||
}
|
||||
|
||||
var o = this.__offset(offset);
|
||||
if (0 == o)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var pos = this.__vector(o);
|
||||
var len = this.__vector_len(o);
|
||||
return bb.ToArray<T>(pos, len);
|
||||
}
|
||||
|
||||
// Initialize any Table-derived type to point to the union at the given offset.
|
||||
public T __union<T>(int offset) where T : struct, IFlatbufferObject
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user