modernize: Prefer strings.SplitSeq instead of Split

Avoids extra allocations. Added in Go 1.24.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski
2025-12-15 17:53:59 +01:00
parent c9b0a21bb1
commit a25907b485
29 changed files with 50 additions and 50 deletions

View File

@@ -408,7 +408,7 @@ const (
// hasMountInfoOption checks if any of the passed any of the given option values
// are set in the passed in option string.
func hasMountInfoOption(opts string, vals ...string) bool {
for _, opt := range strings.Split(opts, " ") {
for opt := range strings.SplitSeq(opts, " ") {
for _, val := range vals {
if strings.HasPrefix(opt, val) {
return true