refactor field

This commit is contained in:
Josh Baker 2016-07-12 22:51:01 -06:00
parent b08c686c64
commit 4656c4c8f3
3 changed files with 10 additions and 10 deletions

View File

@ -48,7 +48,7 @@ func (c *Controller) cmdScan(msg *server.Message) (res string, err error) {
} }
sw.count = uint64(count) sw.count = uint64(count)
} else { } else {
g := glob.Parse(sw.glob, s.desc) g := glob.Parse(sw.globPattern, s.desc)
if g.Limits[0] == "" && g.Limits[1] == "" { if g.Limits[0] == "" && g.Limits[1] == "" {
s.cursor = sw.col.Scan(s.cursor, stype, s.desc, s.cursor = sw.col.Scan(s.cursor, stype, s.desc,
func(id string, o geojson.Object, fields []float64) bool { func(id string, o geojson.Object, fields []float64) bool {

View File

@ -46,7 +46,7 @@ type scanWriter struct {
once bool once bool
count uint64 count uint64
precision uint64 precision uint64
glob string globPattern string
globEverything bool globEverything bool
globSingle bool globSingle bool
fullFields bool fullFields bool
@ -75,12 +75,12 @@ func (c *Controller) newScanWriter(
c: c, c: c,
wr: wr, wr: wr,
msg: msg, msg: msg,
output: output,
wheres: wheres,
precision: precision,
nofields: nofields,
glob: globPattern,
limit: limit, limit: limit,
wheres: wheres,
output: output,
nofields: nofields,
precision: precision,
globPattern: globPattern,
matchValues: matchValues, matchValues: matchValues,
} }
if globPattern == "*" || globPattern == "" { if globPattern == "*" || globPattern == "" {
@ -241,7 +241,7 @@ func (sw *scanWriter) writeObject(id string, o geojson.Object, fields []float64,
keepGoing := true keepGoing := true
if !sw.globEverything { if !sw.globEverything {
if sw.globSingle { if sw.globSingle {
if sw.glob != id { if sw.globPattern != id {
return true return true
} }
keepGoing = false // return current object and stop iterating keepGoing = false // return current object and stop iterating
@ -252,7 +252,7 @@ func (sw *scanWriter) writeObject(id string, o geojson.Object, fields []float64,
} else { } else {
val = id val = id
} }
ok, _ := glob.Match(sw.glob, val) ok, _ := glob.Match(sw.globPattern, val)
if !ok { if !ok {
return true return true
} }

View File

@ -374,7 +374,7 @@ func (c *Controller) cmdSearch(msg *server.Message) (res string, err error) {
} }
sw.count = uint64(count) sw.count = uint64(count)
} else { } else {
g := glob.Parse(sw.glob, s.desc) g := glob.Parse(sw.globPattern, s.desc)
if g.Limits[0] == "" && g.Limits[1] == "" { if g.Limits[0] == "" && g.Limits[1] == "" {
s.cursor = sw.col.SearchValues(s.cursor, stype, s.desc, s.cursor = sw.col.SearchValues(s.cursor, stype, s.desc,
func(id string, o geojson.Object, fields []float64) bool { func(id string, o geojson.Object, fields []float64) bool {