mirror of
https://github.com/photoprism/photoprism.git
synced 2026-01-23 02:24:24 +00:00
refactor: replace Split in loops with more efficient SplitSeq
Signed-off-by: vicerace <vicerace@sohu.com>
This commit is contained in:
parent
957383c708
commit
b0dc4952e2
2 changed files with 3 additions and 3 deletions
|
|
@ -11,7 +11,7 @@ import (
|
|||
// parseCommaSeparatedValues parses comma separated string into a map.
|
||||
func parseCommaSeparatedValues(values string) FilterValues {
|
||||
m := make(FilterValues)
|
||||
for _, v := range strings.Split(values, ",") {
|
||||
for v := range strings.SplitSeq(values, ",") {
|
||||
v = strings.TrimSpace(v)
|
||||
if len(v) == 0 {
|
||||
continue
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ func IsDomain(d string) bool {
|
|||
if IsLocalSuffix(d) {
|
||||
return false
|
||||
}
|
||||
parts := strings.Split(d, ".")
|
||||
for _, p := range parts {
|
||||
parts := strings.SplitSeq(d, ".")
|
||||
for p := range parts {
|
||||
if !IsLabel(p) {
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue