Rename maxVersion() to max()

bzip2
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) return swapWords(v1) >= swapWords(v2)
} }
fun maxVersion(v1: Int, v2: Int): Int { fun max(v1: Int, v2: Int): Int {
return if (gte(v1, v2)) { return if (gte(v1, v2)) {
v1 v1
} else { } 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 } clazz.fields.removeIf { it.name == getstatic1.name && it.desc == getstatic1.desc }
classLiterals++ classLiterals++

@ -89,7 +89,7 @@ class StaticScramblingTransformer : Transformer() {
val (staticClass, staticClinit) = nextClass() val (staticClass, staticClinit) = nextClass()
staticClass.fields.addAll(fieldSet.fields) 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) { if (fieldSet.clinit != null) {
// remove tail RETURN // remove tail RETURN
@ -169,7 +169,7 @@ class StaticScramblingTransformer : Transformer() {
val (staticClass, _) = nextClass() val (staticClass, _) = nextClass()
staticClass.methods.add(method) 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)]!! val partition = inheritedMethodSets[MemberRef(clazz, method)]!!
methodClasses[partition] = staticClass.name methodClasses[partition] = staticClass.name

Loading…
Cancel
Save