void rehash()

in src/xalanc/Include/XalanMap.hpp [590:619]


    void rehash()
    {
        // grow the number of buckets by 60%
        const size_type     theNewSize = size_type(1.6 * size());
        assert(theNewSize != 0);

        BucketTableType     temp(
                                theNewSize,
                                BucketType(*m_memoryManager),
                                *m_memoryManager);

        // rehash each entry assign to bucket and insert into list
        EntryListIterator   entryPos = m_entries.begin();

        while (entryPos != m_entries.end())
        {
            const size_type     index =
                doHash(
                    entryPos->value->first,
                    theNewSize);

            temp[index].push_back(entryPos);

            ++entryPos;
        }

        // Now that we've rebuilt the buckets, swap the rebuilt
        // buckets with our existing buckets.
        m_buckets.swap(temp);
    }