mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-01 21:43:57 +00:00
[Swift] Implements FlatbuffersVector which confirms to RandomAccessCollection (#8752)
* Implements FlatbuffersVector in swift Implements FlatbuffersVector which confirms to RandomAccessCollection, this would give us semi-native sugary syntax to all the arrays in swift port. This work will also be the foundation of using arrays in swift * Fix failing tests for Swift
This commit is contained in:
@@ -58,8 +58,8 @@ public struct Reference {
|
||||
byteBuffer: ByteBuffer,
|
||||
offset: Int,
|
||||
parentWidth: UInt8,
|
||||
packedType: UInt8
|
||||
) {
|
||||
packedType: UInt8)
|
||||
{
|
||||
guard let type = FlexBufferType(rawValue: UInt64(packedType >> 2)) else {
|
||||
return nil
|
||||
}
|
||||
@@ -76,8 +76,8 @@ public struct Reference {
|
||||
offset: Int,
|
||||
parentWidth: UInt8,
|
||||
byteWidth: UInt8,
|
||||
type: FlexBufferType
|
||||
) {
|
||||
type: FlexBufferType)
|
||||
{
|
||||
self.byteBuffer = byteBuffer
|
||||
self.offset = offset
|
||||
self.parentWidth = parentWidth
|
||||
@@ -241,8 +241,7 @@ public struct Reference {
|
||||
@inline(__always)
|
||||
public func withUnsafeRawPointer<Result>(
|
||||
_ completion: (UnsafeRawPointer) throws
|
||||
-> Result
|
||||
)
|
||||
-> Result)
|
||||
rethrows -> Result?
|
||||
{
|
||||
return try byteBuffer.readWithUnsafeRawPointer(
|
||||
|
||||
Reference in New Issue
Block a user