forked from mirror/redis
commit
1e9f53a8e7
|
@ -2,6 +2,13 @@
|
|||
|
||||
package redis
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func bytesToString(b []byte) string {
|
||||
return string(b)
|
||||
bytesHeader := (*reflect.SliceHeader)(unsafe.Pointer(&b))
|
||||
strHeader := reflect.StringHeader{bytesHeader.Data, bytesHeader.Len}
|
||||
return *(*string)(unsafe.Pointer(&strHeader))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue