jmap: remove unneeded function

This commit is contained in:
Pascal Bleser
2026-07-07 11:33:54 +02:00
parent 6387fa2515
commit 2006b1f6f8

View File

@@ -893,8 +893,7 @@ func NewStalwartTest(t *testing.T, options ...func(*importSettings)) (*StalwartT
}
domains := structs.Uniq(structs.Map(users[:], func(u User) string {
parts := strings.Split(u.Email, "@")
return parts[1]
return strings.Split(u.Email, "@")[1]
}))
slices.Sort(domains)
@@ -1107,16 +1106,6 @@ func NewStalwartTest(t *testing.T, options ...func(*importSettings)) (*StalwartT
}, nil
}
var urlHostRegex = regexp.MustCompile(`^(https?://)(.+?)/(.+)$`)
func replaceHostProto(u string, proto string, host string) (string, error) {
if m := urlHostRegex.FindAllStringSubmatch(u, -1); m != nil {
return fmt.Sprintf("%s://%s/%s", proto, host, m[0][3]), nil
} else {
return "", fmt.Errorf("'%v' does not match '%v'", u, urlHostRegex)
}
}
func pickRandomlyFromMap[K comparable, V any](m map[K]V, min int, max int) map[K]V {
if min < 0 || max < 0 {
panic("min and max must be >= 0")