diff options
author | Wim <wim@42.be> | 2020-09-04 23:29:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-04 23:29:13 +0200 |
commit | 2f59abdda7a1072036ea1fdb4c859cccbb56efa6 (patch) | |
tree | e35393f23d12783ae92f0469085efc7dec953f82 /vendor/github.com/valyala/fasttemplate/unsafe.go | |
parent | 17747a5c8893fd47ba8eb61dd10477170640caf6 (diff) | |
download | matterbridge-msglm-2f59abdda7a1072036ea1fdb4c859cccbb56efa6.tar.gz matterbridge-msglm-2f59abdda7a1072036ea1fdb4c859cccbb56efa6.tar.bz2 matterbridge-msglm-2f59abdda7a1072036ea1fdb4c859cccbb56efa6.zip |
Update vendor (#1228)
Diffstat (limited to 'vendor/github.com/valyala/fasttemplate/unsafe.go')
-rw-r--r-- | vendor/github.com/valyala/fasttemplate/unsafe.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/vendor/github.com/valyala/fasttemplate/unsafe.go b/vendor/github.com/valyala/fasttemplate/unsafe.go index 0498248f..1020ca38 100644 --- a/vendor/github.com/valyala/fasttemplate/unsafe.go +++ b/vendor/github.com/valyala/fasttemplate/unsafe.go @@ -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 } |