MCPcopy Create free account
hub / github.com/LagrangeDev/LagrangeGo / B2S

Function B2S

utils/string.go:14–20  ·  view source on GitHub ↗

B2S converts byte slice to a string without memory allocation.

(b []byte)

Source from the content-addressed store, hash-verified

12
13// B2S converts byte slice to a string without memory allocation.
14func B2S(b []byte) string {
15 size := len(b)
16 if size == 0 {
17 return ""
18 }
19 return unsafe.String(&b[0], size)
20}
21
22// S2B converts string to a byte slice without memory allocation.
23//

Callers 11

FetchQRCodeMethod · 0.92
ParseMemberIncreaseEventFunction · 0.92
ParseMemberDecreaseEventFunction · 0.92
decodeFunction · 0.92
StringMethod · 0.92
ReadStringMethod · 0.92
ReadStringWithLengthMethod · 0.92
ParseMessageElementsFunction · 0.92
BuildElementMethod · 0.92
FaceIDStringMethod · 0.92

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected