From 6419816b472c9afeffc028175d9379871dcdb29e Mon Sep 17 00:00:00 2001 From: josesilveiraa <85128820+josesilveiraa@users.noreply.github.com> Date: Wed, 8 Jun 2022 22:59:32 +0000 Subject: [PATCH] refactor: more readable code - Changes singular `prefix` vararg to `prefixes`. - Changes `_prefix` in loop to `prefix` --- src/main/kotlin/app/revanced/extensions/Extensions.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/app/revanced/extensions/Extensions.kt b/src/main/kotlin/app/revanced/extensions/Extensions.kt index 7797d890..4a129074 100644 --- a/src/main/kotlin/app/revanced/extensions/Extensions.kt +++ b/src/main/kotlin/app/revanced/extensions/Extensions.kt @@ -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 -} \ No newline at end of file +}