diff --git a/src/main/kotlin/app/revanced/patcher/extensions/Extensions.kt b/src/main/kotlin/app/revanced/patcher/extensions/Extensions.kt index f8286312..5531b9bd 100644 --- a/src/main/kotlin/app/revanced/patcher/extensions/Extensions.kt +++ b/src/main/kotlin/app/revanced/patcher/extensions/Extensions.kt @@ -220,17 +220,15 @@ private fun replaceOffset( */ internal fun Method.cloneMutable(registerCount: Int = 0) = clone(registerCount).toMutable() -// FIXME: also check the order of parameters as different order equals different method overload internal fun parametersEqual( parameters1: Iterable, parameters2: Iterable ): Boolean { - return parameters1.count() == parameters2.count() && parameters1.all { parameter -> - parameters2.any { - it.startsWith( - parameter - ) - } + if (parameters1.count() != parameters2.count()) return false + val iterator1 = parameters1.iterator() + parameters2.forEach { + if (!it.startsWith(iterator1.next())) return false } + return true } internal val nullOutputStream = object : OutputStream() {