Fixes spelling mistake in the word position (#8330)

This commit is contained in:
mustiikhalil
2024-10-05 00:16:28 +02:00
committed by GitHub
parent 2436bd8175
commit b127c57ff0
12 changed files with 57 additions and 59 deletions

View File

@@ -24,7 +24,7 @@ public struct Table {
/// Hosting Bytebuffer
public private(set) var bb: ByteBuffer
/// Current position of the table within the buffer
public private(set) var postion: Int32
public private(set) var position: Int32
/// Initializer for the table interface to allow generated code to read
/// data from memory
@@ -38,7 +38,7 @@ public struct Table {
"Reading/Writing a buffer in big endian machine is not supported on swift")
}
self.bb = bb
postion = position
self.position = position
}
/// Gets the offset of the current field within the buffer by reading
@@ -46,7 +46,7 @@ public struct Table {
/// - Parameter o: current offset
/// - Returns: offset of field within buffer
public func offset(_ o: Int32) -> Int32 {
let vtable = postion - bb.read(def: Int32.self, position: Int(postion))
let vtable = position - bb.read(def: Int32.self, position: Int(position))
return o < bb
.read(def: VOffset.self, position: Int(vtable)) ? Int32(bb.read(
def: Int16.self,
@@ -64,7 +64,7 @@ public struct Table {
/// String reads from the buffer with respect to position of the current table.
/// - Parameter offset: Offset of the string
public func string(at offset: Int32) -> String? {
directString(at: offset + postion)
directString(at: offset + position)
}
/// Direct string reads from the buffer disregarding the position of the table.
@@ -84,7 +84,7 @@ public struct Table {
/// - type: Type of Element that needs to be read from the buffer
/// - o: Offset of the Element
public func readBuffer<T>(of type: T.Type, at o: Int32) -> T {
directRead(of: T.self, offset: o + postion)
directRead(of: T.self, offset: o + position)
}
/// Reads from the buffer disregarding the position of the table.
@@ -110,7 +110,7 @@ public struct Table {
/// - Parameter o: offset
/// - Returns: A flatbuffers object
public func union<T: FlatbuffersInitializable>(_ o: Int32) -> T {
let o = o + postion
let o = o + position
return directUnion(o)
}
@@ -136,7 +136,7 @@ public struct Table {
/// - returns: Count of elements
public func vector(count o: Int32) -> Int32 {
var o = o
o += postion
o += position
o += bb.read(def: Int32.self, position: Int(o))
return bb.read(def: Int32.self, position: Int(o))
}
@@ -146,7 +146,7 @@ public struct Table {
/// - returns: the start index of the vector
public func vector(at o: Int32) -> Int32 {
var o = o
o += postion
o += position
return o + bb.read(def: Int32.self, position: Int(o)) + 4
}