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"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/params"
|
"github.com/ethereum/go-ethereum/params"
|
||||||
|
|
@ -136,14 +137,9 @@ func (c *Container) MarshalBinary() []byte {
|
||||||
|
|
||||||
// Write section contents.
|
// Write section contents.
|
||||||
for _, ty := range c.types {
|
for _, ty := range c.types {
|
||||||
b = append(b, []byte{ty.inputs, ty.outputs, byte(ty.maxStackHeight >> 8), byte(ty.maxStackHeight & 0x00ff)}...)
|
b = append(b, 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 = slices.Concat(b, slices.Concat(c.codeSections...), slices.Concat(encodedContainer...))
|
||||||
b = append(b, c.data...)
|
b = append(b, c.data...)
|
||||||
|
|
||||||
return b
|
return b
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"slices"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
|
@ -50,11 +51,7 @@ func NewApp(usage string) *cli.App {
|
||||||
|
|
||||||
// Merge merges the given flag slices.
|
// Merge merges the given flag slices.
|
||||||
func Merge(groups ...[]cli.Flag) []cli.Flag {
|
func Merge(groups ...[]cli.Flag) []cli.Flag {
|
||||||
var ret []cli.Flag
|
return slices.Concat(groups...)
|
||||||
for _, group := range groups {
|
|
||||||
ret = append(ret, group...)
|
|
||||||
}
|
|
||||||
return ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var migrationApplied = map[*cli.Command]struct{}{}
|
var migrationApplied = map[*cli.Command]struct{}{}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue