mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-29 06:20:02 +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:
@@ -117,9 +117,9 @@ func toFixedTypedVectorElementType(type: FlexBufferType)
|
||||
let fixedType: UInt64 = numericCast(
|
||||
type.rawValue &- FlexBufferType.vectorInt2
|
||||
.rawValue)
|
||||
let len: Int = numericCast((fixedType / 3) + 2)
|
||||
let len: Int = numericCast(fixedType.dividedReportingOverflow(by: 3).partialValue &+ 2)
|
||||
return (
|
||||
FlexBufferType(rawValue: (fixedType % 3) + FlexBufferType.int.rawValue),
|
||||
FlexBufferType(rawValue: (fixedType.quotientAndRemainder(dividingBy: 3).remainder) &+ FlexBufferType.int.rawValue),
|
||||
len)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user