From 265cfde198c43a434abe5962aaf0d2455c189197 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 11 Apr 2024 09:41:29 +0200 Subject: [PATCH] =?utf8?q?=E2=99=BB=EF=B8=8F=20Use=20method=20references?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../rhynodge/filters/webpages/epicgames/EpicGamesFilter.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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() -- 2.7.4