mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-18 04:53:06 +01:00
Merge branch 'master' of github.com:bkaradzic/bx
This commit is contained in:
@@ -82,6 +82,6 @@ namespace bx
|
||||
} // namespace bx
|
||||
|
||||
// Annoying C++0x stuff..
|
||||
namespace std { namespace tr1 {}; using namespace tr1; }
|
||||
//namespace std { namespace tr1 {}; using namespace tr1; }
|
||||
|
||||
#endif // BX_H_HEADER_GUARD
|
||||
|
||||
@@ -452,8 +452,8 @@ namespace bx
|
||||
}
|
||||
|
||||
const KeyT hash = mix(_key);
|
||||
const uint32_t first = hash % MaxCapacityT;
|
||||
uint32_t idx = first;
|
||||
const uint32_t firstIdx = hash % MaxCapacityT;
|
||||
uint32_t idx = firstIdx;
|
||||
do
|
||||
{
|
||||
if (m_handle[idx] == invalid)
|
||||
@@ -471,7 +471,7 @@ namespace bx
|
||||
|
||||
idx = (idx + 1) % MaxCapacityT;
|
||||
|
||||
} while (idx != first);
|
||||
} while (idx != firstIdx);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -577,8 +577,8 @@ namespace bx
|
||||
{
|
||||
const KeyT hash = mix(_key);
|
||||
|
||||
const uint32_t first = hash % MaxCapacityT;
|
||||
uint32_t idx = first;
|
||||
const uint32_t firstIdx = hash % MaxCapacityT;
|
||||
uint32_t idx = firstIdx;
|
||||
do
|
||||
{
|
||||
if (m_handle[idx] == invalid)
|
||||
@@ -593,7 +593,7 @@ namespace bx
|
||||
|
||||
idx = (idx + 1) % MaxCapacityT;
|
||||
|
||||
} while (idx != first);
|
||||
} while (idx != firstIdx);
|
||||
|
||||
return UINT32_MAX;
|
||||
}
|
||||
|
||||
@@ -43,9 +43,8 @@ namespace bx
|
||||
///
|
||||
inline size_t strnlen(const char* _str, size_t _max)
|
||||
{
|
||||
const char* end = _str + _max;
|
||||
const char* ptr;
|
||||
for (ptr = _str; ptr < end && *ptr != '\0'; ++ptr) {};
|
||||
for (ptr = _str; 0 < _max && *ptr != '\0'; ++ptr, --_max) {};
|
||||
return ptr - _str;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user