for (loop = 0; (loop < HASHSIZE) && (distance < max); loop++) {
curkey = gethashtableentry(loop);
while (curkey != NULL && distance < max) {
for (loop = 0; (loop < HASHSIZE) && (distance < max); loop++) {
curkey = gethashtableentry(loop);
while (curkey != NULL && distance < max) {