Code cleanup: get rid of unnecessary !! / as, fake warning comments and issues
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user