erigon-pulse/erigon-lib/common/copybytes.go

13 lines
222 B
Go
Raw Permalink Normal View History

package common
// CopyBytes returns an exact copy of the provided bytes.
func CopyBytes(b []byte) (copiedBytes []byte) {
if b == nil {
return nil
}
copiedBytes = make([]byte, len(b))
copy(copiedBytes, b)
return
}