Skip to content

Commit

Permalink
[chore] initialize slice with enough capacity based on log records (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme authored Nov 11, 2024
1 parent c92c21e commit 3394d44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extension/encoding/jsonlogencodingextension/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (e *jsonLogExtension) Shutdown(_ context.Context) error {
}

func (e *jsonLogExtension) logProcessor(ld plog.Logs) ([]byte, error) {
logs := make([]logBody, ld.ResourceLogs().Len()-1)
logs := make([]logBody, 0, ld.LogRecordCount())

rls := ld.ResourceLogs()
for i := 0; i < rls.Len(); i++ {
Expand Down

0 comments on commit 3394d44

Please sign in to comment.