Optimize condition matching
This commit is contained in:
parent
49e0fc5a05
commit
b6db92f0a0
|
@ -99,14 +99,13 @@ func (b *Buffer) Lookup(pattern string, conds map[string]interface{}) (res map[s
|
||||||
for _, row := range s.Points {
|
for _, row := range s.Points {
|
||||||
good := true
|
good := true
|
||||||
for key, val := range conds {
|
for key, val := range conds {
|
||||||
ki, _ := colind[key]
|
if ki, _ := colind[key]; row[ki] != val {
|
||||||
if row[ki] != val {
|
|
||||||
good = false
|
good = false
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if good {
|
if good {
|
||||||
_, ok := res[s.Name]
|
if _, ok := res[s.Name]; !ok {
|
||||||
if !ok {
|
|
||||||
res[s.Name] = &influxdb.Series{
|
res[s.Name] = &influxdb.Series{
|
||||||
Name: s.Name,
|
Name: s.Name,
|
||||||
Columns: s.Columns,
|
Columns: s.Columns,
|
||||||
|
|
Loading…
Reference in New Issue