From 69313ae3be85c4fbd550f9563bfad4f03ef1ae37 Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Tue, 31 Jul 2012 20:27:41 +0400 Subject: [PATCH] Removed redundant null checking. --- libraries/stdlib/src/kotlin/dom/Dom.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/stdlib/src/kotlin/dom/Dom.kt b/libraries/stdlib/src/kotlin/dom/Dom.kt index 2d2d11fb025..80dfd5894f9 100644 --- a/libraries/stdlib/src/kotlin/dom/Dom.kt +++ b/libraries/stdlib/src/kotlin/dom/Dom.kt @@ -376,7 +376,7 @@ fun Element.createElement(name: String, doc: Document? = null, init: Element.()- /** Returns the owner document of the element or uses the provided document */ fun Node.ownerDocument(doc: Document? = null): Document { - val answer = if (this != null && this.nodeType == Node.DOCUMENT_NODE) this as Document + val answer = if (this.nodeType == Node.DOCUMENT_NODE) this as Document else if (doc == null) this.ownerDocument else doc