Code cleanup: get rid of unnecessary !! / as, fake warning comments and issues

This commit is contained in:
Mikhail Glukhikh
2015-12-14 12:21:03 +03:00
parent 4ffd60cf52
commit 233e8e58e8
12 changed files with 14 additions and 7 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ import kotlin.dom.*
* Creates a new element which can be configured via a function
*/
fun Document.createElement(name: String, init: Element.() -> Unit): Element {
val elem = this.createElement(name)!!
val elem = this.createElement(name)
elem.init()
return elem
}
@@ -16,7 +16,7 @@ fun Document.createElement(name: String, init: Element.() -> Unit): Element {
* Creates a new element to an element which has an owner Document which can be configured via a function
*/
fun Element.createElement(name: String, doc: Document? = null, init: Element.() -> Unit): Element {
val elem = ownerDocument(doc).createElement(name)!!
val elem = ownerDocument(doc).createElement(name)
elem.init()
return elem
}