mirror of
https://github.com/bitwarden/server
synced 2026-01-06 02:23:51 +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:
@@ -13,9 +13,9 @@ public class DomainMappingService : IDomainMappingService
|
||||
|
||||
public string MapDomain(string hostname)
|
||||
{
|
||||
if (_map.ContainsKey(hostname))
|
||||
if (_map.TryGetValue(hostname, out var mappedDomain))
|
||||
{
|
||||
return _map[hostname];
|
||||
return mappedDomain;
|
||||
}
|
||||
|
||||
return hostname;
|
||||
|
||||
Reference in New Issue
Block a user