From: David ‘Bombe’ Roden Date: Sun, 23 Apr 2017 15:23:20 +0000 (+0200) Subject: Simplify some code X-Git-Tag: 0.9.7^2~239 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=d9165cde615f02b1ab342d17456dd124ebc4f5bf;p=Sone.git Simplify some code --- 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() }