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

Method internBytes

pkg/parquetquery/intern/intern.go:39–48  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

37}
38
39func (i *Interner) internBytes(b []byte) []byte {
40 if x, ok := i.m[bytesToString(b)]; ok {
41 return x
42 }
43
44 clone := make([]byte, len(b))
45 copy(clone, b)
46 i.m[bytesToString(clone)] = clone
47 return clone
48}
49
50func (i *Interner) Close() {
51 clear(i.m) // clear the map

Callers 2

UnsafeCloneMethod · 0.95
TestInterner_internBytesFunction · 0.80

Calls 1

bytesToStringFunction · 0.85

Tested by 1

TestInterner_internBytesFunction · 0.64