mirror of https://github.com/go-redis/redis.git
Disable unsafe.
This commit is contained in:
parent
73e1e9f501
commit
03faf5daed
|
@ -2,13 +2,6 @@
|
||||||
|
|
||||||
package redis
|
package redis
|
||||||
|
|
||||||
import (
|
|
||||||
"reflect"
|
|
||||||
"unsafe"
|
|
||||||
)
|
|
||||||
|
|
||||||
func bytesToString(b []byte) string {
|
func bytesToString(b []byte) string {
|
||||||
bytesHeader := (*reflect.SliceHeader)(unsafe.Pointer(&b))
|
return string(b)
|
||||||
strHeader := reflect.StringHeader{bytesHeader.Data, bytesHeader.Len}
|
|
||||||
return *(*string)(unsafe.Pointer(&strHeader))
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue