MCPcopy
hub / github.com/grafana/tempo / extendReuseSlice

Function extendReuseSlice

tempodb/encoding/vparquet4/schema.go:926–935  ·  view source on GitHub ↗
(sz int, in []T)

Source from the content-addressed store, hash-verified

924}
925
926func extendReuseSlice[T any](sz int, in []T) []T {
927 if cap(in) >= sz {
928 // slice is large enough
929 return in[:sz]
930 }
931
932 out := make([]T, sz)
933 copy(out, in)
934 return out
935}

Callers 6

eventToParquetFunction · 0.70
linkToParquetFunction · 0.70
TestExtendReuseSliceFunction · 0.70

Calls

no outgoing calls

Tested by 2

TestExtendReuseSliceFunction · 0.56