From 69bc72552de0d5575362181f684677509c2ed0e9 Mon Sep 17 00:00:00 2001 From: David Perez Date: Thu, 2 May 2024 10:50:46 -0500 Subject: [PATCH] Optimize when statement in EnvironmentUrlDataJsonExtensions (#1331) --- .../util/EnvironmentUrlDataJsonExtensions.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/x8bit/bitwarden/data/platform/repository/util/EnvironmentUrlDataJsonExtensions.kt b/app/src/main/java/com/x8bit/bitwarden/data/platform/repository/util/EnvironmentUrlDataJsonExtensions.kt index 170a30ef9..cc6bcc5c3 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/platform/repository/util/EnvironmentUrlDataJsonExtensions.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/platform/repository/util/EnvironmentUrlDataJsonExtensions.kt @@ -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) }