Skip to content
This repository was archived by the owner on Apr 15, 2024. It is now read-only.

Commit 616d14f

Browse files
committed
perf: Use a HashSet to check for included and excluded patches
1 parent b2055ce commit 616d14f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/kotlin/app/revanced/cli/command/PatchCommand.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ internal object PatchCommand : Runnable {
3737
@CommandLine.Option(
3838
names = ["-i", "--include"], description = ["List of patches to include."]
3939
)
40-
private var includedPatches = arrayOf<String>()
40+
private var includedPatches = hashSetOf<String>()
4141

4242
@CommandLine.Option(
4343
names = ["--ii"],
@@ -48,7 +48,7 @@ internal object PatchCommand : Runnable {
4848
@CommandLine.Option(
4949
names = ["-e", "--exclude"], description = ["List of patches to exclude."]
5050
)
51-
private var excludedPatches = arrayOf<String>()
51+
private var excludedPatches = hashSetOf<String>()
5252

5353
@CommandLine.Option(
5454
names = ["--ei"],
@@ -200,7 +200,7 @@ internal object PatchCommand : Runnable {
200200

201201
// Warn if a patch can not be found in the supplied patch bundles.
202202
if (warn) patches.map { it.name }.toHashSet().let { availableNames ->
203-
arrayOf(*includedPatches, *excludedPatches).filter { name ->
203+
(includedPatches + excludedPatches).filter { name ->
204204
!availableNames.contains(name)
205205
}
206206
}.let { unknownPatches ->

0 commit comments

Comments
 (0)