Fix some isEmptyBranch and getNodeID performance issues.

This commit is contained in:
JoelKatz
2013-03-05 22:16:07 -08:00
parent eccb6eb936
commit 22111adbaa
3 changed files with 30 additions and 23 deletions

View File

@@ -23,9 +23,11 @@ DECLARE_INSTANCE(SHAMapTreeNode);
void SHAMapNode::setHash() const
{
#if 0
std::size_t h = theApp->getNonceST() + (mDepth * 0x9e3779b9);
mHash = mNodeID.hash_combine(h);
#if 0
#else
std::size_t h = theApp->getNonceST() + (mDepth * 0x9e3779b9);
const unsigned int *ptr = reinterpret_cast<const unsigned int *>(mNodeID.begin());
for (int i = (mDepth + 3) / 4; i != 0; --i)
boost::hash_combine(h, *ptr++);