mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
signer: optimize parseBytes
This commit is contained in:
parent
342285b139
commit
273b8c0eee
1 changed files with 3 additions and 3 deletions
|
|
@ -547,9 +547,9 @@ func parseBytes(encType interface{}) ([]byte, bool) {
|
|||
// Handle array types.
|
||||
val := reflect.ValueOf(encType)
|
||||
if val.Kind() == reflect.Array && val.Type().Elem().Kind() == reflect.Uint8 {
|
||||
v := reflect.ValueOf(make([]byte, val.Len()))
|
||||
reflect.Copy(v, val)
|
||||
return v.Bytes(), true
|
||||
newV := reflect.New(val.Type()).Elem()
|
||||
newV.Set(val)
|
||||
return newV.Bytes(), true
|
||||
}
|
||||
|
||||
switch v := encType.(type) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue