Removes the inner loop in the endtable check written tables (#5803)

This commit is contained in:
mustiikhalil
2020-03-12 12:13:03 -07:00
committed by GitHub
parent 0e3fdd0eea
commit 0dba63909f
2 changed files with 11 additions and 13 deletions
+1 -1
View File
@@ -118,7 +118,7 @@ public final class ByteBuffer {
/// - size: Size of Value being written to the buffer
func push(struct value: UnsafeMutableRawPointer, size: Int) {
ensureSpace(size: UInt32(size))
_memory.advanced(by: writerIndex - size).copyMemory(from: value, byteCount: size)
memcpy(_memory.advanced(by: writerIndex - size), value, size)
defer { value.deallocate() }
_writerSize += size
}