mirror of
https://github.com/goharbor/harbor.git
synced 2025-12-05 04:54:30 +01:00
refactor: replace Split in loops with more efficient SplitSeq (#22494)
Signed-off-by: rustversion <rustverion@outlook.com>
This commit is contained in:
parent
5402ac7233
commit
01f848e7f2
@ -214,7 +214,7 @@ func getWhitelistedAdapters(ctx context.Context) map[string]struct{} {
|
||||
return nil
|
||||
}
|
||||
adapterWhitelist := make(map[string]struct{})
|
||||
for _, adapter := range strings.Split(adapterWhitelistRaw, ",") {
|
||||
for adapter := range strings.SplitSeq(adapterWhitelistRaw, ",") {
|
||||
adapter = strings.TrimSpace(adapter)
|
||||
if adapter != "" {
|
||||
adapterWhitelist[adapter] = struct{}{}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user