Fix btree keys not being properly compared

This commit is contained in:
DBotThePony 2023-10-12 19:16:21 +07:00
parent 0b163481e7
commit 8d8d4029a7
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -30,9 +30,9 @@ private operator fun ByteArray.compareTo(b: ByteArray): Int {
require(size == b.size) { "Keys are not of same size (${size} vs ${b.size})" }
for (i in indices) {
if (this[i] > b[i]) {
if (this[i].toInt() and 0xFF > b[i].toInt() and 0xFF) {
return 1
} else if (this[i] < b[i]) {
} else if (this[i].toInt() and 0xFF < b[i].toInt() and 0xFF) {
return -1
}
}