There's a return value for hash collisions.
Ah, I didn't know this was a possibility. Still, given that it doesn't seem complicated and you have to compare the key at least once anyway, I wonder why not comparing the key too in the RB comparison function, so you just never have to declare a cache collision, and there is less that can go wrong in the caller.