mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Cleanups.
This commit is contained in:
@@ -124,8 +124,9 @@ SHAMapTreeNode* SHAMap::walkToPointer(const uint256& id)
|
||||
while (!inNode->isLeaf())
|
||||
{
|
||||
int branch = inNode->selectBranch(id);
|
||||
if (inNode->isEmptyBranch(branch)) return NULL;
|
||||
inNode = getNodePointer(inNode->getChildNodeID(branch), inNode->getChildHash(branch));
|
||||
const uint256& nextHash = inNode->getChildHash(branch);
|
||||
if (!nextHash) return NULL;
|
||||
inNode = getNodePointer(inNode->getChildNodeID(branch), nextHash);
|
||||
if (!inNode) throw SHAMapException(MissingNode);
|
||||
}
|
||||
return (inNode->getTag() == id) ? inNode : NULL;
|
||||
|
||||
@@ -179,10 +179,14 @@ public:
|
||||
// inner node functions
|
||||
bool isInnerNode() const { return !mItem; }
|
||||
bool setChildHash(int m, const uint256& hash);
|
||||
const uint256& getChildHash(int m) const;
|
||||
bool isEmptyBranch(int m) const { return !mHashes[m]; }
|
||||
int getBranchCount() const;
|
||||
void makeInner();
|
||||
const uint256& getChildHash(int m) const
|
||||
{
|
||||
assert((m >= 0) && (m < 16) && (mType == tnINNER));
|
||||
return mHashes[m];
|
||||
}
|
||||
|
||||
// item node function
|
||||
bool hasItem() const { return !!mItem; }
|
||||
|
||||
@@ -370,9 +370,4 @@ bool SHAMapTreeNode::setChildHash(int m, const uint256 &hash)
|
||||
return updateHash();
|
||||
}
|
||||
|
||||
const uint256& SHAMapTreeNode::getChildHash(int m) const
|
||||
{
|
||||
assert((m >= 0) && (m < 16) && (mType == tnINNER));
|
||||
return mHashes[m];
|
||||
}
|
||||
// vim:ts=4
|
||||
|
||||
Reference in New Issue
Block a user