apply some of @ddirect suggestions

This commit is contained in:
Patricio Whittingslow
2025-12-22 18:41:14 -03:00
parent 5e631a1b3d
commit f6bc73ee6c
7 changed files with 104 additions and 41 deletions
+11
View File
@@ -56,3 +56,14 @@ func SetIPAddrs(buf []byte, id uint16, src, dst []byte) (err error) {
copy(dstaddr, dst)
return nil
}
// IsZeroed returns true if all arguments are set to their zero value.
func IsZeroed[T comparable](a ...T) bool {
var z T
for i := range a {
if a[i] != z {
return false
}
}
return true
}