From d9165cde615f02b1ab342d17456dd124ebc4f5bf Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 23 Apr 2017 17:23:20 +0200 Subject: [PATCH] Simplify some code --- .../net/pterodactylus/sone/template/LinkedElementRenderFilter.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/net/pterodactylus/sone/template/LinkedElementRenderFilter.kt b/src/main/kotlin/net/pterodactylus/sone/template/LinkedElementRenderFilter.kt index e15f68b..a527a1d 100644 --- a/src/main/kotlin/net/pterodactylus/sone/template/LinkedElementRenderFilter.kt +++ b/src/main/kotlin/net/pterodactylus/sone/template/LinkedElementRenderFilter.kt @@ -34,8 +34,7 @@ class LinkedElementRenderFilter @Inject constructor(private val templateContextF StringWriter().use { val templateContext = templateContextFactory.createTemplateContext() templateContext["link"] = linkedElement.link - loadedImageTemplate.render(templateContext, it) - it + it.also { loadedImageTemplate.render(templateContext, it) } }.toString() private fun renderHtmlPage(linkedElement: LinkedElement) = @@ -51,8 +50,7 @@ class LinkedElementRenderFilter @Inject constructor(private val templateContextF StringWriter().use { val templateContext = templateContextFactory.createTemplateContext() templateContext["link"] = linkedElement.link - notLoadedImageTemplate.render(templateContext, it) - it + it.also { notLoadedImageTemplate.render(templateContext, it) } }.toString() } -- 2.7.4