unix: switch (*CPUSet).Zero to clear builtin

clear was added to Go 1.21 and is better than the manual loop approach.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
This commit is contained in:
Aleksa Sarai
2025-08-21 17:40:50 +10:00
parent 543f21a056
commit 71dc7f073e

View File

@@ -38,9 +38,7 @@ func SchedSetaffinity(pid int, set *CPUSet) error {
// Zero clears the set s, so that it contains no CPUs.
func (s *CPUSet) Zero() {
for i := range s {
s[i] = 0
}
clear(s[:])
}
func cpuBitsIndex(cpu int) int {