Add ClassVersionUtils

master
Graham 5 years ago
parent 5c5a908a37
commit bfcb373ade
  1. 15
      asm/src/main/java/dev/openrs2/asm/ClassVersionUtils.kt

@ -0,0 +1,15 @@
package dev.openrs2.asm
object ClassVersionUtils {
private fun swapWords(v: Int): Int {
return (v shl 16) or (v ushr 16)
}
fun maxVersion(v1: Int, v2: Int): Int {
return if (swapWords(v1) > swapWords(v2)) {
v1
} else {
v2
}
}
}
Loading…
Cancel
Save