mirror of
https://github.com/FiloSottile/mkcert.git
synced 2025-10-14 00:41:40 +08:00
Initial commit and macOS install
This commit is contained in:
20
vendor/github.com/DHowett/go-plist/zerocopy.go
generated
vendored
Normal file
20
vendor/github.com/DHowett/go-plist/zerocopy.go
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
// +build !appengine
|
||||
|
||||
package plist
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func zeroCopy8BitString(buf []byte, off int, len int) string {
|
||||
if len == 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
var s string
|
||||
hdr := (*reflect.StringHeader)(unsafe.Pointer(&s))
|
||||
hdr.Data = uintptr(unsafe.Pointer(&buf[off]))
|
||||
hdr.Len = len
|
||||
return s
|
||||
}
|
Reference in New Issue
Block a user