From: David ‘Bombe’ Roden Date: Thu, 11 Apr 2024 07:41:29 +0000 (+0200) Subject: ♻️ Use method references X-Git-Tag: v2^2~6 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=265cfde198c43a434abe5962aaf0d2455c189197;p=rhynodge.git ♻️ Use method references --- diff --git a/src/main/kotlin/net/pterodactylus/rhynodge/filters/webpages/epicgames/EpicGamesFilter.kt b/src/main/kotlin/net/pterodactylus/rhynodge/filters/webpages/epicgames/EpicGamesFilter.kt index 31bb11f..36d007c 100644 --- a/src/main/kotlin/net/pterodactylus/rhynodge/filters/webpages/epicgames/EpicGamesFilter.kt +++ b/src/main/kotlin/net/pterodactylus/rhynodge/filters/webpages/epicgames/EpicGamesFilter.kt @@ -25,9 +25,9 @@ class EpicGamesFilter : Filter { private fun getPromotionalOfferDate(gameJson: JsonNode, date: String) = listOf("promotionalOffers", "upcomingPromotionalOffers") .map { "/promotions/$it/0/promotionalOffers/0/$date" } - .map { gameJson.at(it) } - .filter { !it.isMissingNode } - .map { it.asText() } + .map(gameJson::at) + .filterNot(JsonNode::isMissingNode) + .map(JsonNode::asText) .map(Instant::parse) .first()