Hotfix for previous commit

This commit is contained in:
tidwall 2020-07-04 10:35:07 -07:00
parent f3622c3756
commit f23b46cfc0
1 changed files with 4 additions and 4 deletions

View File

@ -399,14 +399,14 @@ func (sw *scanWriter) writeObject(opts ScanWriterParams) bool {
}
} else if len(sw.farr) > 0 {
fvs := orderFields(sw.fmap, sw.farr, opts.fields)
jsfields = `,"fields":[`
for i, fv := range fvs {
for i, name := range sw.farr {
if i > 0 {
jsfields += `,`
}
if len(opts.fields) > i {
jsfields += strconv.FormatFloat(fv.value, 'f', -1, 64)
j := sw.fmap[name]
if j < len(opts.fields) {
jsfields += strconv.FormatFloat(opts.fields[j], 'f', -1, 64)
} else {
jsfields += "0"
}