From 438bb43d84ada6a50993e77cd81526445f5c56d8 Mon Sep 17 00:00:00 2001
From: TheBusyBiscuit <TheBusyBiscuit@users.noreply.github.com>
Date: Mon, 14 Jun 2021 12:22:05 +0200
Subject: [PATCH] Changed ifelse structure into a simple return statement
 (sonarcloud: `kotlin:S1125`) (COMMUNITY) (#3427)

* Bump to next Version 1.11.0.8 (DEV) #2220

* Changed ifelse structure into a simple return statement

See `kotlin:S1125` on sonarcloud

Co-authored-by: Matthias Urhahn <matthias.urhahn@sap.com>
Co-authored-by: CWA Technical User <67319337+Corona-Warn-App-Technical-User@users.noreply.github.com>
Co-authored-by: harambasicluka <64483219+harambasicluka@users.noreply.github.com>
---
 .../de/rki/coronawarnapp/coronatest/CoronaTestRepository.kt   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/coronatest/CoronaTestRepository.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/coronatest/CoronaTestRepository.kt
index 9af108afe..06648265c 100644
--- a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/coronatest/CoronaTestRepository.kt
+++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/coronatest/CoronaTestRepository.kt
@@ -121,7 +121,7 @@ class CoronaTestRepository @Inject constructor(
 
         val toRefresh = internalData.data
             .first().values
-            .filter { if (type == null) true else it.type == type }
+            .filter { type == null || it.type == type }
             .map { it.identifier }
 
         Timber.tag(TAG).d("Will refresh %s", toRefresh)
@@ -134,7 +134,7 @@ class CoronaTestRepository @Inject constructor(
 
         val refreshedData = internalData.updateBlocking {
             val polling = values
-                .filter { if (type == null) true else it.type == type }
+                .filter { type == null || it.type == type }
                 .filter { toRefresh.contains(it.identifier) }
                 .map { coronaTest ->
 
-- 
GitLab