MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / unsafeString

Function unsafeString

pkg/util/encoding/encoding.go:759–761  ·  view source on GitHub ↗

unsafeString 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 modified.

(b []byte)

Source from the content-addressed store, hash-verified

757// allows the string to be mutable through the []byte. We're careful to use
758// this method only in situations in which the []byte will not be modified.
759func unsafeString(b []byte) string {
760 return *(*string)(unsafe.Pointer(&b))
761}
762
763// DecodeUnsafeStringAscending decodes a string value from the input buffer which was
764// encoded using EncodeString or EncodeBytes. The r []byte is used as a

Callers 3

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…