[logger map] small optimization

Rather than doing two key writes and one lookup, just write once.
This commit is contained in:
max furman 2020-08-12 16:35:38 -07:00
parent 55bf5a4526
commit 8e3481a8ef

View file

@ -414,9 +414,10 @@ func LogCertificate(w http.ResponseWriter, cert *x509.Certificate) {
if err != nil || len(rest) > 0 {
break
}
m["provisioner"] = fmt.Sprintf("%s", val.Name)
if len(val.CredentialID) > 0 {
m["provisioner"] = fmt.Sprintf("%s (%s)", m["provisioner"], val.CredentialID)
m["provisioner"] = fmt.Sprintf("%s (%s)", val.Name, val.CredentialID)
} else {
m["provisioner"] = fmt.Sprintf("%s", val.Name)
}
break
}