Yes, it will always run the full algorithm. Mainly because I never thought about it. Giving it an early out would technically cause different behaviour because if you're exactly on a threshold and there's another one very close by, that other one might end up with non-zero weight due to the way the algorithm works. It would also mean the worse case performance (running the whole algorithm) is a bit worse because you're also checking for equality, but the overall average performance would likely be higher since being at (0,0) or a cardinal direction if using a keyboard is quite common. So it's probably worth implementing, but I'd add a static bool to disable it just in case. I'll put it on my to do list for the next version.