refactor: more readable code

- Changes singular `prefix` vararg to `prefixes`.
- Changes `_prefix` in loop to `prefix`
This commit is contained in:
josesilveiraa 2022-06-08 22:59:32 +00:00 committed by oSumAtrIX
parent ee50ac01a4
commit 6419816b47

View file

@ -19,9 +19,9 @@ internal fun Node.doRecursively(action: (Node) -> Unit) {
for (i in 0 until this.childNodes.length) this.childNodes.item(i).doRecursively(action) for (i in 0 until this.childNodes.length) this.childNodes.item(i).doRecursively(action)
} }
internal fun String.startsWithAny(vararg prefix: String): Boolean { internal fun String.startsWithAny(vararg prefixes: String): Boolean {
for (_prefix in prefix) for (prefix in prefixes)
if (this.startsWith(_prefix)) if (this.startsWith(prefix))
return true return true
return false return false
@ -33,4 +33,4 @@ internal fun String.containsAny(vararg others: String): Boolean {
return true return true
return false return false
} }