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 {
good := true
for key, val := range conds {
ki, _ := colind[key]
if row[ki] != val {
if ki, _ := colind[key]; row[ki] != val {
good = false
break
}
}
if good {
_, ok := res[s.Name]
if !ok {
if _, ok := res[s.Name]; !ok {
res[s.Name] = &influxdb.Series{
Name: s.Name,
Columns: s.Columns,