1
0
Fork 0

Optimize condition matching

This commit is contained in:
Gregory Eremin 2014-10-06 13:21:46 +04:00
parent 49e0fc5a05
commit b6db92f0a0
1 changed files with 3 additions and 4 deletions

View File

@ -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,