mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-21 12:49:10 +00:00
Remove a bunch of unused pnUtils stuff.
This commit is contained in:
@ -437,8 +437,14 @@ void TBaseHashTable<T>::SetLinkOffset (int linkOffset, unsigned maxSize) {
|
||||
m_linkOffset = linkOffset;
|
||||
m_fullList.SetLinkOffset(m_linkOffset + offsetof(THashLink<T>, m_linkToFull));
|
||||
|
||||
if (!m_slotMask)
|
||||
SetSlotCount(max(kSlotMinCount, MathNextPow2(maxSize)));
|
||||
if (!m_slotMask) {
|
||||
// http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
|
||||
uint32_t v = maxSize - 1;
|
||||
v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16;
|
||||
v++;
|
||||
|
||||
SetSlotCount(max(kSlotMinCount, v));
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
Reference in New Issue
Block a user