mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 05:36:46 +00:00
Update reflect.go
This commit is contained in:
parent
fb44e66e60
commit
d29e98d9fd
1 changed files with 1 additions and 1 deletions
|
|
@ -90,7 +90,7 @@ func reflectIntType(unsigned bool, size int) reflect.Type {
|
||||||
// mustArrayToByteSlice creates a new byte slice with the exact same size as value
|
// mustArrayToByteSlice creates a new byte slice with the exact same size as value
|
||||||
// and copies the bytes in value to the new slice.
|
// and copies the bytes in value to the new slice.
|
||||||
func mustArrayToByteSlice(value reflect.Value) reflect.Value {
|
func mustArrayToByteSlice(value reflect.Value) reflect.Value {
|
||||||
slice := reflect.MakeSlice(reflect.TypeFor[[]byte](), value.Len(), value.Len())
|
slice := reflect.ValueOf(make([]byte, value.Len()))
|
||||||
reflect.Copy(slice, value)
|
reflect.Copy(slice, value)
|
||||||
return slice
|
return slice
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue