mirror of
https://github.com/go-gitea/gitea
synced 2025-09-28 03:28:13 +00:00
Update github.com/blevesearch/bleve v1.0.13 -> v1.0.14 (#13947)
This commit is contained in:
17
vendor/github.com/tinylib/msgp/msgp/unsafe.go
generated
vendored
17
vendor/github.com/tinylib/msgp/msgp/unsafe.go
generated
vendored
@@ -3,7 +3,6 @@
|
||||
package msgp
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
@@ -24,18 +23,14 @@ const (
|
||||
// THIS IS EVIL CODE.
|
||||
// YOU HAVE BEEN WARNED.
|
||||
func UnsafeString(b []byte) string {
|
||||
sh := (*reflect.SliceHeader)(unsafe.Pointer(&b))
|
||||
return *(*string)(unsafe.Pointer(&reflect.StringHeader{Data: sh.Data, Len: sh.Len}))
|
||||
return *(*string)(unsafe.Pointer(&b))
|
||||
}
|
||||
|
||||
// UnsafeBytes returns the string as a byte slice
|
||||
// THIS SHOULD ONLY BE USED BY THE CODE GENERATOR.
|
||||
// THIS IS EVIL CODE.
|
||||
// YOU HAVE BEEN WARNED.
|
||||
//
|
||||
// Deprecated:
|
||||
// Since this code is no longer used by the code generator,
|
||||
// UnsafeBytes(s) is precisely equivalent to []byte(s)
|
||||
func UnsafeBytes(s string) []byte {
|
||||
return *(*[]byte)(unsafe.Pointer(&reflect.SliceHeader{
|
||||
Len: len(s),
|
||||
Cap: len(s),
|
||||
Data: (*(*reflect.StringHeader)(unsafe.Pointer(&s))).Data,
|
||||
}))
|
||||
return []byte(s)
|
||||
}
|
||||
|
Reference in New Issue
Block a user