mirror of
https://github.com/bitwarden/server
synced 2026-01-09 03:53:42 +00:00
[PM-14476] Avoid multiple lookups in dictionaries (#4973)
* Avoid multiple lookups in dictionaries * Consistency in fallback to empty CollectionIds * Readability at the cost of lines changed * Readability * Changes after running dotnet format
This commit is contained in:
@@ -63,6 +63,6 @@ public class DistributedCacheCookieManager : ICookieManager
|
||||
private string GetKey(string key, string id) => $"{CacheKeyPrefix}-{key}-{id}";
|
||||
|
||||
private string GetId(HttpContext context, string key) =>
|
||||
context.Request.Cookies.ContainsKey(key) ?
|
||||
context.Request.Cookies[key] : null;
|
||||
context.Request.Cookies.TryGetValue(key, out var cookie) ?
|
||||
cookie : null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user