Skip to content

Commit

Permalink
core, internal: use slices.Concat
Browse files Browse the repository at this point in the history
  • Loading branch information
hteevoli authored Oct 29, 2024
1 parent 4397c71 commit 6c53241
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
10 changes: 3 additions & 7 deletions core/vm/eof.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"errors"
"fmt"
"io"
"slices"
"strings"

"github.com/ethereum/go-ethereum/params"
Expand Down Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions internal/flags/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"fmt"
"os"
"regexp"
"slices"
"sort"
"strings"

Expand Down Expand Up @@ -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{}{}
Expand Down

0 comments on commit 6c53241

Please sign in to comment.