Omit fields for Resp when NOFIELDS is used. (#198)

fixes #198
This commit is contained in:
Josh Baker 2017-07-21 15:56:29 -07:00
parent d9c46a3f29
commit 29634f86ba
1 changed files with 13 additions and 12 deletions

View File

@ -386,6 +386,7 @@ func (sw *scanWriter) writeObject(opts ScanWriterParams) bool {
}))
}
if sw.hasFieldsOutput() {
fvs := orderFields(sw.fmap, opts.fields)
if len(fvs) > 0 {
fvals := make([]resp.Value, 0, len(fvs)*2)
@ -395,7 +396,7 @@ func (sw *scanWriter) writeObject(opts ScanWriterParams) bool {
}
vals = append(vals, resp.ArrayValue(fvals))
}
}
if opts.distance > 0 {
vals = append(vals, resp.FloatValue(opts.distance))
}