Changeset 2808


Ignore:
Timestamp:
Jul 22, 2013, 2:38:56 AM (4 years ago)
Author:
sam
Message:

base: fix map.h build.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lol/base/map.h

    r2807 r2808  
    4444    {
    4545        /* Look for the hash in our table and return the value if found. */
    46         int i = FindIndex(key);
     46        uint32_t hash = ((Hash<K> const &)*this)(key);
     47        int i = FindIndex(key, hash);
    4748        if (i >= 0)
    4849            return m_array[i].m3;
     
    8788private:
    8889    template <typename E>
    89     int FindIndex(E const &key)
     90    inline int FindIndex(E const &key, uint32_t hash)
    9091    {
    91         uint32_t hash = ((Hash<K> const &)*this)(key);
    9292        for (int i = 0; i < m_array.Count(); ++i)
    9393            if (m_array[i].m1 == hash)
     
    9595                    return i;
    9696        return -1;
     97    }
     98
     99    template <typename E>
     100    inline int FindIndex(E const &key)
     101    {
     102        uint32_t hash = ((Hash<K> const &)*this)(key);
     103        return FindIndex(key, hash);
    97104    }
    98105
Note: See TracChangeset for help on using the changeset viewer.