MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / UnsafeConvertBytesToString

Function UnsafeConvertBytesToString

pkg/util/encoding/encoding.go:995–997  ·  view source on GitHub ↗

UnsafeConvertBytesToString performs an unsafe conversion from a []byte to a string. The returned string will share the underlying memory with the []byte which thus allows the string to be mutable through the []byte. We're careful to use this method only in situations in which the []byte will not be

(b []byte)

Source from the content-addressed store, hash-verified

993// careful to use this method only in situations in which the []byte will not
994// be modified.
995func UnsafeConvertBytesToString(b []byte) string {
996 return *(*string)(unsafe.Pointer(&b))
997}
998
999// DecodeUnsafeStringAscending decodes a string value from the input buffer which was
1000// encoded using EncodeString or EncodeBytes. The r []byte is used as a

Callers 7

ResolveBlankPaddedCharFunction · 0.92
ParseDByteFunction · 0.92
unsafeJSONStringFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…