ripple-api/vendor/gopkg.in/redis.v5/internal/unsafe.go
Morgan Bazalgette 3961e310b1 vendor!
2017-01-14 18:42:10 +01:00

15 lines
289 B
Go

// +build !appengine
package internal
import (
"reflect"
"unsafe"
)
func BytesToString(b []byte) string {
bytesHeader := (*reflect.SliceHeader)(unsafe.Pointer(&b))
strHeader := reflect.StringHeader{bytesHeader.Data, bytesHeader.Len}
return *(*string)(unsafe.Pointer(&strHeader))
}