4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-18 13:38:54 +00:00

Update vendor (#1228)

This commit is contained in:
Wim
2020-09-04 23:29:13 +02:00
committed by GitHub
parent 17747a5c88
commit 2f59abdda7
1436 changed files with 21840 additions and 3466 deletions

View File

@ -11,12 +11,11 @@ func unsafeBytes2String(b []byte) string {
return *(*string)(unsafe.Pointer(&b))
}
func unsafeString2Bytes(s string) []byte {
func unsafeString2Bytes(s string) (b []byte) {
sh := (*reflect.StringHeader)(unsafe.Pointer(&s))
bh := reflect.SliceHeader{
Data: sh.Data,
Len: sh.Len,
Cap: sh.Len,
}
return *(*[]byte)(unsafe.Pointer(&bh))
bh := (*reflect.SliceHeader)(unsafe.Pointer(&b))
bh.Data = sh.Data
bh.Cap = sh.Len
bh.Len = sh.Len
return b
}