mirror of
https://github.com/revanced/revanced-cli.git
synced 2024-11-11 14:19:25 +01:00
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
This commit is contained in:
parent
a5851f0c1a
commit
11c3a6cfd4
@ -62,14 +62,17 @@ internal object Options {
|
||||
|
||||
val patchOptions = deserialize(json)
|
||||
|
||||
patches.forEach { patch ->
|
||||
patches.forEach patch@{ patch ->
|
||||
patchOptions.find { option -> option.patchName == patch.patchName }?.let {
|
||||
it.options.forEach { option ->
|
||||
try {
|
||||
patch.options?.set(option.key, option.value)
|
||||
?: logger.warning("${patch.patchName} has no options")
|
||||
?: run{
|
||||
logger.warning("${patch.patchName} has no options")
|
||||
return@patch
|
||||
}
|
||||
} catch (e: NoSuchOptionException) {
|
||||
logger.info(e.message ?: "Unknown error")
|
||||
logger.info(e.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user