mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
core, internal: use slices.Concat
This commit is contained in:
parent
4397c712ac
commit
6c53241c37
2 changed files with 5 additions and 12 deletions
|
|
@ -22,6 +22,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
|
|
@ -136,14 +137,9 @@ func (c *Container) MarshalBinary() []byte {
|
|||
|
||||
// Write section contents.
|
||||
for _, ty := range c.types {
|
||||
b = append(b, []byte{ty.inputs, ty.outputs, byte(ty.maxStackHeight >> 8), byte(ty.maxStackHeight & 0x00ff)}...)
|
||||
}
|
||||
for _, code := range c.codeSections {
|
||||
b = append(b, code...)
|
||||
}
|
||||
for _, section := range encodedContainer {
|
||||
b = append(b, section...)
|
||||
b = append(b, ty.inputs, ty.outputs, byte(ty.maxStackHeight >> 8), byte(ty.maxStackHeight & 0x00ff))
|
||||
}
|
||||
b = slices.Concat(b, slices.Concat(c.codeSections...), slices.Concat(encodedContainer...))
|
||||
b = append(b, c.data...)
|
||||
|
||||
return b
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
"regexp"
|
||||
"slices"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
|
|
@ -50,11 +51,7 @@ func NewApp(usage string) *cli.App {
|
|||
|
||||
// Merge merges the given flag slices.
|
||||
func Merge(groups ...[]cli.Flag) []cli.Flag {
|
||||
var ret []cli.Flag
|
||||
for _, group := range groups {
|
||||
ret = append(ret, group...)
|
||||
}
|
||||
return ret
|
||||
return slices.Concat(groups...)
|
||||
}
|
||||
|
||||
var migrationApplied = map[*cli.Command]struct{}{}
|
||||
|
|
|
|||
Loading…
Reference in a new issue