mirror of
https://github.com/bitwarden/server
synced 2025-12-15 15:53:59 +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:
@@ -15,9 +15,9 @@ public class TwoFactorEmailResponseModel : ResponseModel
|
||||
}
|
||||
|
||||
var provider = user.GetTwoFactorProvider(TwoFactorProviderType.Email);
|
||||
if (provider?.MetaData?.ContainsKey("Email") ?? false)
|
||||
if (provider?.MetaData?.TryGetValue("Email", out var email) ?? false)
|
||||
{
|
||||
Email = (string)provider.MetaData["Email"];
|
||||
Email = (string)email;
|
||||
Enabled = provider.Enabled;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user