Skip to content

Commit

Permalink
Apply PR suggestion: remove useless index variable
Browse files Browse the repository at this point in the history
  • Loading branch information
RenanLukas committed Feb 28, 2024
1 parent 4c41107 commit 2753869
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ class ReaderDiscoverLogic @Inject constructor(
*/
@Suppress("NestedBlockDepth")
private fun createSimplifiedJson(cardsJsonArray: JSONArray, discoverTasks: DiscoverTasks): JSONArray {
var index = 0
val simplifiedJsonList = mutableListOf<JSONObject>()
var firstYouMayLikeCard: JSONObject? = null
for (i in 0 until cardsJsonArray.length()) {
Expand All @@ -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))
}
}
}
Expand All @@ -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))
}
}
}
Expand Down

0 comments on commit 2753869

Please sign in to comment.