compareTo

open operator override fun compareTo(other: Key): Int

Unsigned lexicographic comparison; the shorter key wins when one is a prefix of the other.

Arrays.compareUnsigned is used rather than a hand-written loop because the JDK intrinsifies it, and key comparison is the innermost operation of every lookup and every merge.