Skip to content

Commit

Permalink
fix(util): specify map len (#15831)
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Melanchyk <arturmelanchyk@imail.name>
  • Loading branch information
arturmelanchyk authored Jan 17, 2025
1 parent 71e30bb commit 3d9e9d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/util/marshal/marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ func WriteSeriesResponseJSON(series []logproto.SeriesIdentifier, w io.Writer) er
}

for _, series := range series {
m := make(map[string]string, 0)
for _, pair := range series.GetLabels() {
labels := series.GetLabels()
m := make(map[string]string, len(labels))
for _, pair := range labels {
m[pair.Key] = pair.Value
}
adapter.Data = append(adapter.Data, m)
Expand Down

0 comments on commit 3d9e9d9

Please sign in to comment.