MCPcopy Create free account
hub / github.com/buger/jsonparser / bytesEqualStrUnsafeSlower

Function bytesEqualStrUnsafeSlower

bytes_unsafe_test.go:26–30  ·  view source on GitHub ↗

Test helper for SYS-REQ-001 and SYS-REQ-008.

(abytes *[]byte, bstr string)

Source from the content-addressed store, hash-verified

24
25// Test helper for SYS-REQ-001 and SYS-REQ-008.
26func bytesEqualStrUnsafeSlower(abytes *[]byte, bstr string) bool {
27 aslicehdr := (*reflect.SliceHeader)(unsafe.Pointer(abytes))
28 astrhdr := reflect.StringHeader{Data: aslicehdr.Data, Len: aslicehdr.Len}
29 return *(*string)(unsafe.Pointer(&astrhdr)) == bstr
30}
31
32// Verifies: SYS-REQ-001
33// MCDC SYS-REQ-001: N/A

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected