Pre-allocate map for performance

pull/7311/head
Edd Robinson 2016-09-15 17:26:30 +01:00
parent 1a9de4c9b8
commit ed41122ade
1 changed files with 5 additions and 1 deletions

View File

@ -1088,7 +1088,11 @@ func (m *Measurement) walkWhereForSeriesIds(expr influxql.Expr) (SeriesIDs, Filt
return nil, nil, err
}
filters := FilterExprs{}
if len(ids) == 0 {
return ids, nil, nil
}
filters := make(FilterExprs, len(ids))
for _, id := range ids {
filters[id] = expr
}