Skip to content

Commit

Permalink
Pre-allocate map for performance
Browse files Browse the repository at this point in the history
  • Loading branch information
e-dard committed Sep 15, 2016
1 parent 1a9de4c commit ed41122
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tsdb/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit ed41122

Please sign in to comment.