diff options
author | cyBerta <cyberta@riseup.net> | 2024-12-03 02:04:15 +0100 |
---|---|---|
committer | cyberta <cyberta@riseup.net> | 2024-12-11 00:09:34 +0000 |
commit | d5fa16775ff3156bbbbd1583b1171e273614b6ca (patch) | |
tree | a808891bb609967825b37ca4183988671db6c228 /app/src/main/java | |
parent | 139d7ecb0d2532436c380fc12c0df164b35d0b4a (diff) |
replace switch with if condition in ProviderApiManagerFactory
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderApiManagerFactory.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderApiManagerFactory.java b/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderApiManagerFactory.java index b6c1c955..3eae410f 100644 --- a/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderApiManagerFactory.java +++ b/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderApiManagerFactory.java @@ -16,12 +16,10 @@ public class ProviderApiManagerFactory { } public IProviderApiManager getProviderApiManager(Provider provider) throws IllegalArgumentException { - switch (provider.getApiVersion()) { - case 5: - return new ProviderApiManagerV5(resources, callback); - default: - OkHttpClientGenerator clientGenerator = new OkHttpClientGenerator(resources); - return new ProviderApiManagerV3(resources, clientGenerator, callback); + if (provider.getApiVersion() >= 5) { + return new ProviderApiManagerV5(resources, callback); } + OkHttpClientGenerator clientGenerator = new OkHttpClientGenerator(resources); + return new ProviderApiManagerV3(resources, clientGenerator, callback); } } |