Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add | Cache TokenCredential objects to take advantage of token caching #2380

Merged
merged 12 commits into from
Jun 12, 2024
Prev Previous commit
Next Next commit
Optimize AreEqual function
David-Engel committed May 24, 2024
commit 22c457db01bb2ee1ce6af564a8fdfef009d112a3
Original file line number Diff line number Diff line change
@@ -520,7 +520,7 @@ private static byte[] GetHash(string input)

private static bool AreEqual(byte[] a1, byte[] a2)
{
if (a1 is null && a2 is null)
if (ReferenceEquals(a1, a2))
{
return true;
}
@@ -533,13 +533,7 @@ private static bool AreEqual(byte[] a1, byte[] a2)
return false;
}

for (int i = 0; i < a1.Length; i++)
{
if (a1[i] != a2[i])
return false;
}

return true;
return a1.AsSpan().SequenceEqual(a2.AsSpan());
}

private IPublicClientApplication CreateClientAppInstance(PublicClientAppKey publicClientAppKey)
Loading