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:
Kir Kolyshkin 2025-09-17 18:00:10 -07:00 committed by Sean Liao
parent 00bf24fdca
commit 0ab038af62

View file

@ -661,9 +661,7 @@ func (state *assignState) tryAllocRegs(typ *types.Type) []RegIndex {
func (pa *ABIParamAssignment) ComputePadding(storage []uint64) []uint64 {
nr := len(pa.Registers)
padding := storage[:nr]
for i := 0; i < nr; i++ {
padding[i] = 0
}
clear(padding)
if pa.Type.Kind() != types.TSTRUCT || nr == 0 {
return padding
}