fix: Accept PatchSet in PatchesConsumer#acceptPatches

This deprecates accepting `List<Patch<*>>`
This commit is contained in:
oSumAtrIX
2023-12-01 23:10:23 +01:00
parent 58bd46750b
commit 716825f232
3 changed files with 10 additions and 2 deletions

View File

@@ -46,7 +46,7 @@ class Patcher(
* @param patches The [Patch]es to add.
*/
@Suppress("NAME_SHADOWING")
override fun acceptPatches(patches: List<Patch<*>>) {
override fun acceptPatches(patches: PatchSet) {
/**
* Add dependencies of a [Patch] recursively to [PatcherContext.allPatches].
* If a [Patch] is already in [PatcherContext.allPatches], it will not be added again.

View File

@@ -4,5 +4,7 @@ import app.revanced.patcher.patch.Patch
@FunctionalInterface
interface PatchesConsumer {
fun acceptPatches(patches: List<Patch<*>>)
@Deprecated("Use acceptPatches(PatchSet) instead.", ReplaceWith("acceptPatches(patches.toSet())"))
fun acceptPatches(patches: List<Patch<*>>) = acceptPatches(patches.toSet())
fun acceptPatches(patches: PatchSet)
}