Skip to content

Commit 0ab038a

Browse files
kolyshkinseankhliao
authored andcommitted
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 <[email protected]> Reviewed-by: Mark Freeman <[email protected]> Reviewed-by: Sean Liao <[email protected]> Reviewed-by: Michael Knyszek <[email protected]>
1 parent 00bf24f commit 0ab038a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/cmd/compile/internal/abi/abiutils.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,9 +661,7 @@ func (state *assignState) tryAllocRegs(typ *types.Type) []RegIndex {
661661
func (pa *ABIParamAssignment) ComputePadding(storage []uint64) []uint64 {
662662
nr := len(pa.Registers)
663663
padding := storage[:nr]
664-
for i := 0; i < nr; i++ {
665-
padding[i] = 0
666-
}
664+
clear(padding)
667665
if pa.Type.Kind() != types.TSTRUCT || nr == 0 {
668666
return padding
669667
}

0 commit comments

Comments
 (0)