mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			290 B
		
	
	
	
		
			Go
		
	
	
	
		
			Vendored
		
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			290 B
		
	
	
	
		
			Go
		
	
	
	
		
			Vendored
		
	
	
	
// +build !appengine
 | 
						|
 | 
						|
package fwd
 | 
						|
 | 
						|
import (
 | 
						|
	"reflect"
 | 
						|
	"unsafe"
 | 
						|
)
 | 
						|
 | 
						|
// unsafe cast string as []byte
 | 
						|
func unsafestr(b string) []byte {
 | 
						|
	l := len(b)
 | 
						|
	return *(*[]byte)(unsafe.Pointer(&reflect.SliceHeader{
 | 
						|
		Len:  l,
 | 
						|
		Cap:  l,
 | 
						|
		Data: (*reflect.StringHeader)(unsafe.Pointer(&b)).Data,
 | 
						|
	}))
 | 
						|
}
 |