File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
pkg/demoinfocs/sendtables2 Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 55 "strings"
66)
77
8- type FieldIndex struct {
8+ type fieldIndex struct {
99 index int
1010 field * field
1111}
@@ -14,7 +14,7 @@ type serializer struct {
1414 name string
1515 version int32
1616 fields []* field
17- fieldIndexes map [string ]* FieldIndex
17+ fieldIndexes map [string ]* fieldIndex
1818}
1919
2020func (s * serializer ) id () string {
@@ -75,12 +75,15 @@ func serializerId(name string, version int32) string {
7575}
7676
7777func (s * serializer ) addField (f * field ) {
78+ newFieldIndex := len (s .fields )
7879 s .fields = append (s .fields , f )
80+
7981 if s .fieldIndexes == nil {
80- s .fieldIndexes = make (map [string ]* FieldIndex )
82+ s .fieldIndexes = make (map [string ]* fieldIndex )
8183 }
82- s .fieldIndexes [f .varName ] = & FieldIndex {
83- index : len (s .fields ) - 1 ,
84+
85+ s .fieldIndexes [f .varName ] = & fieldIndex {
86+ index : newFieldIndex ,
8487 field : f ,
8588 }
8689}
You can’t perform that action at this time.
0 commit comments