From 4656c4c8f321b80e08787fad64d05d64fe02247a Mon Sep 17 00:00:00 2001 From: Josh Baker Date: Tue, 12 Jul 2016 22:51:01 -0600 Subject: [PATCH] refactor field --- controller/scan.go | 2 +- controller/scanner.go | 16 ++++++++-------- controller/search.go | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/controller/scan.go b/controller/scan.go index 1a1a0599..d078c709 100644 --- a/controller/scan.go +++ b/controller/scan.go @@ -48,7 +48,7 @@ func (c *Controller) cmdScan(msg *server.Message) (res string, err error) { } sw.count = uint64(count) } else { - g := glob.Parse(sw.glob, s.desc) + g := glob.Parse(sw.globPattern, s.desc) if g.Limits[0] == "" && g.Limits[1] == "" { s.cursor = sw.col.Scan(s.cursor, stype, s.desc, func(id string, o geojson.Object, fields []float64) bool { diff --git a/controller/scanner.go b/controller/scanner.go index 8dfc4000..5cdc99ef 100644 --- a/controller/scanner.go +++ b/controller/scanner.go @@ -46,7 +46,7 @@ type scanWriter struct { once bool count uint64 precision uint64 - glob string + globPattern string globEverything bool globSingle bool fullFields bool @@ -75,12 +75,12 @@ func (c *Controller) newScanWriter( c: c, wr: wr, msg: msg, - output: output, - wheres: wheres, - precision: precision, - nofields: nofields, - glob: globPattern, limit: limit, + wheres: wheres, + output: output, + nofields: nofields, + precision: precision, + globPattern: globPattern, matchValues: matchValues, } if globPattern == "*" || globPattern == "" { @@ -241,7 +241,7 @@ func (sw *scanWriter) writeObject(id string, o geojson.Object, fields []float64, keepGoing := true if !sw.globEverything { if sw.globSingle { - if sw.glob != id { + if sw.globPattern != id { return true } keepGoing = false // return current object and stop iterating @@ -252,7 +252,7 @@ func (sw *scanWriter) writeObject(id string, o geojson.Object, fields []float64, } else { val = id } - ok, _ := glob.Match(sw.glob, val) + ok, _ := glob.Match(sw.globPattern, val) if !ok { return true } diff --git a/controller/search.go b/controller/search.go index 780f0687..91992dbd 100644 --- a/controller/search.go +++ b/controller/search.go @@ -374,7 +374,7 @@ func (c *Controller) cmdSearch(msg *server.Message) (res string, err error) { } sw.count = uint64(count) } else { - g := glob.Parse(sw.glob, s.desc) + g := glob.Parse(sw.globPattern, s.desc) if g.Limits[0] == "" && g.Limits[1] == "" { s.cursor = sw.col.SearchValues(s.cursor, stype, s.desc, func(id string, o geojson.Object, fields []float64) bool {