1
0
mirror of https://github.com/bitwarden/server synced 2026-01-02 00:23:40 +00:00

Use FrozenDictionary in StaticClientStore (#3833)

* Add Benchmark

* Use FrozenDictionary

* Use TryGetValue

* Format
This commit is contained in:
Justin Baur
2024-02-21 10:29:59 -05:00
committed by GitHub
parent 0abd52b5be
commit 70fac808b0
3 changed files with 33 additions and 5 deletions

View File

@@ -80,9 +80,9 @@ public class ClientStore : IClientStore
return await CreateUserClientAsync(clientId);
}
if (_staticClientStore.ApiClients.ContainsKey(clientId))
if (_staticClientStore.ApiClients.TryGetValue(clientId, out var client))
{
return _staticClientStore.ApiClients[clientId];
return client;
}
return await CreateApiKeyClientAsync(clientId);