소스 검색

base: fix map.h build.

legacy
Sam Hocevar sam 11 년 전
부모
커밋
85ef683cce
1개의 변경된 파일10개의 추가작업 그리고 3개의 파일을 삭제
  1. +10
    -3
      src/lol/base/map.h

+ 10
- 3
src/lol/base/map.h 파일 보기

@@ -43,7 +43,8 @@ public:
inline V & operator[] (E const &key)
{
/* Look for the hash in our table and return the value if found. */
int i = FindIndex(key);
uint32_t hash = ((Hash<K> const &)*this)(key);
int i = FindIndex(key, hash);
if (i >= 0)
return m_array[i].m3;

@@ -86,9 +87,8 @@ public:

private:
template <typename E>
int FindIndex(E const &key)
inline int FindIndex(E const &key, uint32_t hash)
{
uint32_t hash = ((Hash<K> const &)*this)(key);
for (int i = 0; i < m_array.Count(); ++i)
if (m_array[i].m1 == hash)
if (m_array[i].m2 == key)
@@ -96,6 +96,13 @@ private:
return -1;
}

template <typename E>
inline int FindIndex(E const &key)
{
uint32_t hash = ((Hash<K> const &)*this)(key);
return FindIndex(key, hash);
}

Array<uint32_t, K, V> m_array;
};



불러오는 중...
취소
저장