Revert "Performance Increase of Vector of Structures using .NET BlockCopy (#4830)"

This reverts commit 7b50004ec9.

Change-Id: I09d6869c16aa3c7fadc537fc9c76eaa3cf7ee7ea
This commit is contained in:
Wouter van Oortmerssen
2018-08-20 12:08:21 -07:00
parent ea9d60bbdf
commit 1f5eae5d6a
10 changed files with 6 additions and 615 deletions

View File

@@ -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
{