From 275386982437ada3f26f720f21e84efc613c12ad Mon Sep 17 00:00:00 2001 From: Renan Lukas <14964993+RenanLukas@users.noreply.github.com> Date: Wed, 28 Feb 2024 16:55:51 -0300 Subject: [PATCH] Apply PR suggestion: remove useless index variable --- .../ui/reader/services/discover/ReaderDiscoverLogic.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/reader/services/discover/ReaderDiscoverLogic.kt b/WordPress/src/main/java/org/wordpress/android/ui/reader/services/discover/ReaderDiscoverLogic.kt index a77a08adb3b6..9eee7c0d18bf 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/reader/services/discover/ReaderDiscoverLogic.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/reader/services/discover/ReaderDiscoverLogic.kt @@ -199,7 +199,6 @@ class ReaderDiscoverLogic @Inject constructor( */ @Suppress("NestedBlockDepth") private fun createSimplifiedJson(cardsJsonArray: JSONArray, discoverTasks: DiscoverTasks): JSONArray { - var index = 0 val simplifiedJsonList = mutableListOf() var firstYouMayLikeCard: JSONObject? = null for (i in 0 until cardsJsonArray.length()) { @@ -208,7 +207,7 @@ class ReaderDiscoverLogic @Inject constructor( JSON_CARD_RECOMMENDED_BLOGS -> { cardJson.optJSONArray(JSON_CARD_DATA)?.let { recommendedBlogsCardJson -> if (recommendedBlogsCardJson.length() > 0) { - simplifiedJsonList.add(index++, createSimplifiedRecommendedBlogsCardJson(cardJson)) + simplifiedJsonList.add(createSimplifiedRecommendedBlogsCardJson(cardJson)) } } } @@ -218,10 +217,10 @@ class ReaderDiscoverLogic @Inject constructor( firstYouMayLikeCard = cardJson continue } - simplifiedJsonList.add(index++, cardJson) + simplifiedJsonList.add(cardJson) } JSON_CARD_POST -> { - simplifiedJsonList.add(index++, createSimplifiedPostJson(cardJson)) + simplifiedJsonList.add(createSimplifiedPostJson(cardJson)) } } }