Skip to content

Commit

Permalink
chore: merge nested if blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Jun 21, 2022
1 parent 7dabd53 commit 00145f2
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/main/kotlin/app/revanced/utils/patcher/Patcher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@ fun Patcher.addPatchesFiltered(

val prefix = "[skipped] $patchName"

val args = MainCommand.args.pArgs!!
val args = MainCommand.args.pArgs!!

if (excludePatches) {
if (args.excludedPatches.contains(patchName)) {
println("$prefix: Explicitly excluded.")
return@patch
}
if (excludePatches && args.excludedPatches.contains(patchName)) {
println("$prefix: Explicitly excluded.")
return@patch
} else if (!patch.include) {
println("$prefix: Implicitly excluded.")
return@patch
Expand All @@ -43,7 +41,7 @@ fun Patcher.addPatchesFiltered(
return@patch
}

if (!(args.experimental || compatiblePackages.any { it.versions.isEmpty() || it.versions.any { version -> version == packageVersion }})) {
if (!(args.experimental || compatiblePackages.any { it.versions.isEmpty() || it.versions.any { version -> version == packageVersion } })) {
println("$prefix: The package version is $packageVersion and is incompatible.")
return@patch
}
Expand Down

0 comments on commit 00145f2

Please sign in to comment.