MCPcopy
hub / github.com/canopy-network/canopy / Append

Function Append

lib/util.go:945–950  ·  view source on GitHub ↗

Append() is a 'safe append' when the caller wants to re-use the 'a' slice

(a, b []byte)

Source from the content-addressed store, hash-verified

943
944// Append() is a 'safe append' when the caller wants to re-use the 'a' slice
945func Append(a, b []byte) []byte {
946 out := make([]byte, len(a)+len(b))
947 copy(out, a)
948 copy(out[len(a):], b)
949 return out
950}
951
952// AppendWithBuffer() appends a and b into a fresh []byte using a buffer to reduce allocations.
953// The result is safe to retain and use independently of a/b/buffer.

Callers 7

IteratorMethod · 0.92
RevIteratorMethod · 0.92
ArchiveIteratorMethod · 0.92
writeMethod · 0.92
NewIteratorMethod · 0.92
prefixEndFunction · 0.92
purgeLssTombstonesMethod · 0.92

Calls 1

copyFunction · 0.50

Tested by

no test coverage detected