private short findKey(short key) {
        short hashcode = (short)((key & 0x7fff) % capacity);

        short p = indexer.first(hashcode);

        while (p != -1) {
            if (keys[p] == key) {
                return p;
            }
            p = indexer.next(p);
        }
        return -1;
    }
Finds the index for a given key.
Ghidra/Framework/Generic/src/main/java/ghidra/util/datastruct/ShortKeyIndexer.java