mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile/internal/abi: use clear built-in
Replace for loop with clear, available since Go 1.21. Change-Id: I949da08b2a11845cc8a02b2639af78835e316970 Reviewed-on: https://go-review.googlesource.com/c/go/+/704879 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Mark Freeman <markfreeman@google.com> Reviewed-by: Sean Liao <sean@liao.dev> Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
parent
00bf24fdca
commit
0ab038af62
1 changed files with 1 additions and 3 deletions
|
|
@ -661,9 +661,7 @@ func (state *assignState) tryAllocRegs(typ *types.Type) []RegIndex {
|
||||||
func (pa *ABIParamAssignment) ComputePadding(storage []uint64) []uint64 {
|
func (pa *ABIParamAssignment) ComputePadding(storage []uint64) []uint64 {
|
||||||
nr := len(pa.Registers)
|
nr := len(pa.Registers)
|
||||||
padding := storage[:nr]
|
padding := storage[:nr]
|
||||||
for i := 0; i < nr; i++ {
|
clear(padding)
|
||||||
padding[i] = 0
|
|
||||||
}
|
|
||||||
if pa.Type.Kind() != types.TSTRUCT || nr == 0 {
|
if pa.Type.Kind() != types.TSTRUCT || nr == 0 {
|
||||||
return padding
|
return padding
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue