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)
}
internal fun String.startsWithAny(vararg prefix: String): Boolean {
for (_prefix in prefix)
if (this.startsWith(_prefix))
internal fun String.startsWithAny(vararg prefixes: String): Boolean {
for (prefix in prefixes)
if (this.startsWith(prefix))
return true
return false
@ -33,4 +33,4 @@ internal fun String.containsAny(vararg others: String): Boolean {
return true
return false
}
}