Skip to content

Commit 11c3a6c

Browse files
committed
fix: only check once for patch options
This prevents checking for the same patches options multiple times when it is already determined to not have any options
1 parent a5851f0 commit 11c3a6c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/kotlin/app/revanced/utils/Options.kt

+6-3
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,17 @@ internal object Options {
6262

6363
val patchOptions = deserialize(json)
6464

65-
patches.forEach { patch ->
65+
patches.forEach patch@{ patch ->
6666
patchOptions.find { option -> option.patchName == patch.patchName }?.let {
6767
it.options.forEach { option ->
6868
try {
6969
patch.options?.set(option.key, option.value)
70-
?: logger.warning("${patch.patchName} has no options")
70+
?: run{
71+
logger.warning("${patch.patchName} has no options")
72+
return@patch
73+
}
7174
} catch (e: NoSuchOptionException) {
72-
logger.info(e.message ?: "Unknown error")
75+
logger.info(e.toString())
7376
}
7477
}
7578
}

0 commit comments

Comments
 (0)