Skip to content

Commit

Permalink
fix: crrect initialization of a few slices (#12674)
Browse files Browse the repository at this point in the history
Co-authored-by: Callum Styan <callumstyan@gmail.com>
  • Loading branch information
seiyab and cstyan authored Apr 18, 2024
1 parent e2952b9 commit 0eba448
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/querier/ingester_querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ func (q *IngesterQuerier) TailersCount(ctx context.Context) ([]uint32, error) {
return nil, err
}

counts := make([]uint32, len(responses))
counts := make([]uint32, 0, len(responses))

for _, resp := range responses {
counts = append(counts, resp.response.(uint32))
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/stores/series/series_index_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ func (c *IndexReaderWriter) chunksToSeries(ctx context.Context, in []logproto.Ch
return nil, err
}

results := make([]labels.Labels, len(chunksBySeries)) // Flatten out the per-job results.
results := make([]labels.Labels, 0, len(chunksBySeries)) // Flatten out the per-job results.
for _, innerSlice := range perJobResults {
results = append(results, innerSlice...)
}
Expand Down

0 comments on commit 0eba448

Please sign in to comment.