mirror of
https://github.com/bitwarden/android.git
synced 2024-11-21 17:05:44 +03:00
Optimize when statement in EnvironmentUrlDataJsonExtensions (#1331)
This commit is contained in:
parent
fd08f39fd9
commit
69bc72552d
1 changed files with 8 additions and 4 deletions
|
@ -111,10 +111,14 @@ private fun EnvironmentUrlDataJson.getSelfHostedUrlOrNull(): String? =
|
|||
*/
|
||||
fun EnvironmentUrlDataJson.toEnvironmentUrls(): Environment =
|
||||
when (this) {
|
||||
EnvironmentUrlDataJson.DEFAULT_US -> Environment.Us
|
||||
EnvironmentUrlDataJson.DEFAULT_LEGACY_US -> Environment.Us
|
||||
EnvironmentUrlDataJson.DEFAULT_EU -> Environment.Eu
|
||||
EnvironmentUrlDataJson.DEFAULT_LEGACY_EU -> Environment.Eu
|
||||
EnvironmentUrlDataJson.DEFAULT_US,
|
||||
EnvironmentUrlDataJson.DEFAULT_LEGACY_US,
|
||||
-> Environment.Us
|
||||
|
||||
EnvironmentUrlDataJson.DEFAULT_EU,
|
||||
EnvironmentUrlDataJson.DEFAULT_LEGACY_EU,
|
||||
-> Environment.Eu
|
||||
|
||||
else -> Environment.SelfHosted(environmentUrlData = this)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue