fix prealloc in trace (#1558)

This commit is contained in:
徐旭 2020-04-22 21:10:59 +08:00 committed by GitHub
parent e25ab9f4ca
commit e55c23164a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,7 @@ func (t *Tracer) Read(opts ...trace.ReadOption) ([]*trace.Span, error) {
sp := t.buffer.Get(t.buffer.Size())
var spans []*trace.Span
spans := make([]*trace.Span, 0, len(sp))
for _, span := range sp {
val := span.Value.(*trace.Span)