830 - BestAlignment::IterateCache()

From Genome Analysis Wiki
Revision as of 13:58, 28 October 2013 by Goncalo (talk | contribs) (Created page with "<source lang="cpp"> unsigned int BestAlignment::IterateCache(unsigned int key) { int h = (key * PRIME) % cacheSize; while (cache[h] != -1 && cache[h] ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
unsigned int BestAlignment::IterateCache(unsigned int key)
        {
        int h = (key * PRIME) % cacheSize;

        while (cache[h] != -1 && cache[h] != key)
           h = h + 1 >= cacheSize ? 0 : h + 1;

        return h;
        }