mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-12 07:50:59 +00:00
Remove all string allocations during parsing.
Change the signature for 'string' getters and settings to use byte slices instead of strings.
This commit is contained in:
@@ -14,12 +14,12 @@ func (rcv *Stat) Init(buf []byte, i flatbuffers.UOffsetT) {
|
||||
rcv._tab.Pos = i
|
||||
}
|
||||
|
||||
func (rcv *Stat) Id() string {
|
||||
func (rcv *Stat) Id() []byte {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
|
||||
if o != 0 {
|
||||
return rcv._tab.String(o + rcv._tab.Pos)
|
||||
return rcv._tab.ByteVector(o + rcv._tab.Pos)
|
||||
}
|
||||
return ""
|
||||
return nil
|
||||
}
|
||||
|
||||
func (rcv *Stat) Val() int64 {
|
||||
|
||||
Reference in New Issue
Block a user