1
0
mirror of https://github.com/go-acme/lego.git synced 2024-12-22 07:12:22 +02:00

chore: domain merge simplification (#2340)

This commit is contained in:
Ludovic Fernandez 2024-11-11 11:20:17 +01:00 committed by GitHub
parent 98371c4695
commit a7aaae4abe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,6 +6,7 @@ import (
"errors"
"math/rand"
"os"
"slices"
"time"
"github.com/go-acme/lego/v4/acme/api"
@ -377,16 +378,12 @@ func addPathToMetadata(meta map[string]string, domain string, certRes *certifica
func merge(prevDomains, nextDomains []string) []string {
for _, next := range nextDomains {
var found bool
for _, prev := range prevDomains {
if prev == next {
found = true
break
}
}
if !found {
prevDomains = append(prevDomains, next)
if slices.Contains(prevDomains, next) {
continue
}
prevDomains = append(prevDomains, next)
}
return prevDomains
}