Rename maxVersion() to max()

Graham 5 years ago
parent bbe4157124
commit 055efd60e7
  1. 2
      asm/src/main/java/dev/openrs2/asm/ClassVersionUtils.kt
  2. 2
      deob/src/main/java/dev/openrs2/deob/transform/ClassLiteralTransformer.kt
  3. 4
      deob/src/main/java/dev/openrs2/deob/transform/StaticScramblingTransformer.kt

@ -9,7 +9,7 @@ object ClassVersionUtils {
return swapWords(v1) >= swapWords(v2)
}
fun maxVersion(v1: Int, v2: Int): Int {
fun max(v1: Int, v2: Int): Int {
return if (gte(v1, v2)) {
v1
} else {

@ -95,7 +95,7 @@ class ClassLiteralTransformer : Transformer() {
}
}
clazz.version = ClassVersionUtils.maxVersion(clazz.version, Opcodes.V1_5)
clazz.version = ClassVersionUtils.max(clazz.version, Opcodes.V1_5)
clazz.fields.removeIf { it.name == getstatic1.name && it.desc == getstatic1.desc }
classLiterals++

@ -89,7 +89,7 @@ class StaticScramblingTransformer : Transformer() {
val (staticClass, staticClinit) = nextClass()
staticClass.fields.addAll(fieldSet.fields)
staticClass.version = ClassVersionUtils.maxVersion(staticClass.version, fieldSet.owner.version)
staticClass.version = ClassVersionUtils.max(staticClass.version, fieldSet.owner.version)
if (fieldSet.clinit != null) {
// remove tail RETURN
@ -169,7 +169,7 @@ class StaticScramblingTransformer : Transformer() {
val (staticClass, _) = nextClass()
staticClass.methods.add(method)
staticClass.version = ClassVersionUtils.maxVersion(staticClass.version, clazz.version)
staticClass.version = ClassVersionUtils.max(staticClass.version, clazz.version)
val partition = inheritedMethodSets[MemberRef(clazz, method)]!!
methodClasses[partition] = staticClass.name

Loading…
Cancel
Save