mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-10 07:06:26 +00:00
[Go] Fix bug where bytes wasn't being imported when using --gen-onefile flag (#7706)
* Fix bug one file import bug * Create reset import function and add braces
This commit is contained in:
@@ -579,12 +579,12 @@ func MonsterKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool {
|
||||
func (rcv *Monster) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool {
|
||||
span := flatbuffers.GetUOffsetT(buf[vectorLocation - 4:])
|
||||
start := flatbuffers.UOffsetT(0)
|
||||
bKey := []byte(key)
|
||||
for span != 0 {
|
||||
middle := span / 2
|
||||
tableOffset := flatbuffers.GetIndirectOffset(buf, vectorLocation+ 4 * (start + middle))
|
||||
obj := &Monster{}
|
||||
obj.Init(buf, tableOffset)
|
||||
bKey := []byte(key)
|
||||
comp := bytes.Compare(obj.Name(), bKey)
|
||||
if comp > 0 {
|
||||
span = middle
|
||||
|
||||
Reference in New Issue
Block a user