Skip to content
This repository has been archived by the owner on Jun 17, 2020. It is now read-only.

Commit

Permalink
Perf fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Grant Dickinson committed Apr 24, 2019
1 parent 3181e3a commit 0a78ae6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/SourceCode.Clay.Security/CertificateLoader.cs
Expand Up @@ -269,16 +269,16 @@ private static bool IsHex(char c)
(c >= 'A' && c <= 'Z') ||
(c >= 'a' && c <= 'z');

private static void DisposeCertificates(X509Certificate2Collection foundCertificates, X509Certificate2 except)
private static void DisposeCertificates(X509Certificate2Collection certificates, X509Certificate2 except)
{
if (foundCertificates != null)
if (certificates == null || certificates.Count == 0)
return;

foreach (X509Certificate2 certificate in certificates)
{
foreach (X509Certificate2 certificate in foundCertificates)
if (except == null || !certificate.Equals(except))
{
if (except == null || !certificate.Equals(except))
{
certificate.Dispose();
}
certificate.Dispose();
}
}
}
Expand Down

0 comments on commit 0a78ae6

Please sign in to comment.