mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 11:38:05 +00:00
[Swift] Moves capacity outside of Storage (#8650)
- Cleans up capacity usage within the lib and moves it outside of the Storage - Use overflow operators
This commit is contained in:
@@ -143,7 +143,7 @@ public struct FlexBuffersWriter {
|
||||
{
|
||||
let vec = createVector(
|
||||
start: start,
|
||||
count: stack.count - start,
|
||||
count: stack.count &- start,
|
||||
step: 1,
|
||||
typed: typed,
|
||||
fixed: fixed,
|
||||
@@ -211,7 +211,7 @@ public struct FlexBuffersWriter {
|
||||
typed: true,
|
||||
fixed: false)
|
||||
let vec = createVector(
|
||||
start: start + 1,
|
||||
start: start &+ 1,
|
||||
count: len,
|
||||
step: 2,
|
||||
typed: false,
|
||||
@@ -598,7 +598,7 @@ public struct FlexBuffersWriter {
|
||||
|
||||
var sloc: UInt = numericCast(writerIndex)
|
||||
key.withCString {
|
||||
_bb.writeBytes($0, len: len + 1)
|
||||
_bb.writeBytes($0, len: len &+ 1)
|
||||
}
|
||||
|
||||
if flags > .shareKeys {
|
||||
@@ -705,7 +705,7 @@ public struct FlexBuffersWriter {
|
||||
/// If this vector is part of a map, we will pre-fix an offset to the keys
|
||||
/// to this vector.
|
||||
bitWidth = max(bitWidth, keys!.elementWidth(size: writerIndex, index: 0))
|
||||
prefixElements += 2
|
||||
prefixElements = prefixElements &+ 2
|
||||
}
|
||||
var vectorType: FlexBufferType = .key
|
||||
|
||||
|
||||
Reference in New Issue
Block a user