mirror of
https://github.com/revanced/revanced-cli.git
synced 2025-06-13 05:37:38 +02: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:
@ -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())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user