mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-01 19:58:15 +00:00
Keep the underlying storage capacity when clearing the FlatBufferBuilder. Gives a significant performance boost for serialisation of many small messages. (#7250)
This commit is contained in:
@@ -127,8 +127,8 @@ public struct FlatBufferBuilder {
|
||||
mutating public func clear() {
|
||||
_minAlignment = 0
|
||||
isNested = false
|
||||
stringOffsetMap = [:]
|
||||
_vtables = []
|
||||
stringOffsetMap.removeAll(keepingCapacity: true)
|
||||
_vtables.removeAll(keepingCapacity: true)
|
||||
_vtableStorage.clear()
|
||||
_bb.clear()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user