Merge pull request #157 from go-redis/fix/disable-unsafe

Disable unsafe.
This commit is contained in:
Vladimir Mihailenco 2015-08-26 09:55:43 +03:00
commit 152c38c687
1 changed files with 1 additions and 8 deletions

View File

@ -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))
} }