You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.nio.ByteBuffer does a lot of checks which adds up esp for map tile loading, might be worth having a byte array implementation for better performance
The text was updated successfully, but these errors were encountered:
Branchless readSmart(). Prob not worth using but I spent the time to make it so I've got to put it somewhere.
funreadSmart(): Int {
val peek = buffer[position++].toInt() and0xffval negative = peek -127// Check if < 127val signum = (negative shr 31) or (-negative ushr 31)
val pos = signum and (signum shr 31).inv() // Convert to 0 if false or 1 if trueval result = (peek shl (8* pos) or (buffer[position].toInt() and0xff) * pos) - (32768* pos)
position +=1* pos
return result
}
java.nio.ByteBuffer does a lot of checks which adds up esp for map tile loading, might be worth having a byte array implementation for better performance
The text was updated successfully, but these errors were encountered: