Skip to content

Commit

Permalink
fix: fix slice init length (#808)
Browse files Browse the repository at this point in the history
* fix: fix slice init length

* Added proper pre-allocation

---------

Co-authored-by: Tasos Derisiotis <[email protected]>
  • Loading branch information
davidwoood and Eengineer1 authored Jan 6, 2025
1 parent 7c7f5ce commit 6c8d0d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/integration/helpers/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ type HumanReadableEvent struct {
}

func ReadableEvents(events []types.Event) []HumanReadableEvent {
readableEvents := make([]HumanReadableEvent, len(events))
readableEvents := make([]HumanReadableEvent, 0, len(events))
for _, event := range events {
readableAttributes := make([]HumanReadableEventAttribute, len(event.Attributes))
readableAttributes := make([]HumanReadableEventAttribute, 0, len(event.Attributes))
for i, attribute := range event.Attributes {
readableAttributes[i] = HumanReadableEventAttribute{
Key: attribute.Key,
Expand Down

0 comments on commit 6c8d0d7

Please sign in to comment.