int (int [] keys, int key) { int hash = (int)((key * 0x9E3779B9L) & 0x7fffffff); int index = hash & (keys.length - 1); int candidate; while ((candidate = keys[index]) != 0) { if (candidate == key) { return index; } if (index == 0) { index = keys.length; } index--; } return index; }