优化代码

This commit is contained in:
刘祥超
2022-09-23 09:28:19 +08:00
parent c568ad3e9a
commit 5655f89ba6
20 changed files with 90 additions and 58 deletions

View File

@@ -149,7 +149,7 @@ func (this *SSLCertDAO) UpdateCert(tx *dbs.Tx,
return nil
}
var oldCert = oldOne.(*SSLCert)
var dataIsChanged = bytes.Compare(certData, oldCert.CertData) != 0 || bytes.Compare(keyData, oldCert.KeyData) != 0
var dataIsChanged = !bytes.Equal(certData, oldCert.CertData) || !bytes.Equal(keyData, oldCert.KeyData)
var op = NewSSLCertOperator()
op.Id = certId