Skip to content

Commit 78db314

Browse files
committed
Preallocate spans slice
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
1 parent 080a7dd commit 78db314

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/collector/app/zipkin/jsonv2.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
)
2222

2323
func spansV2ToThrift(spans models.ListOfSpans) ([]*zipkincore.Span, error) {
24-
var tSpans []*zipkincore.Span
24+
tSpans := make([]*zipkincore.Span, 0, len(spans))
2525
for _, span := range spans {
2626
tSpan, err := spanV2ToThrift(span)
2727
if err != nil {

0 commit comments

Comments
 (0)