mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 02:55:50 +00:00
Fast path the addKnownNode case where the parent is in the cache.
This commit is contained in:
@@ -311,7 +311,8 @@ SHAMapAddNode SHAMap::addKnownNode (const SHAMapNode& node, Blob const& rawNode,
|
|||||||
if (checkCacheNode (node)) // Do we already have this node?
|
if (checkCacheNode (node)) // Do we already have this node?
|
||||||
return SHAMapAddNode::okay ();
|
return SHAMapAddNode::okay ();
|
||||||
|
|
||||||
SHAMapTreeNode* iNode = root.get ();
|
SHAMapTreeNode::pointer parent = checkCacheNode(node.getParentNodeID());
|
||||||
|
SHAMapTreeNode* iNode = parent ? parent.get() : root.get ();
|
||||||
|
|
||||||
while (!iNode->isLeaf () && !iNode->isFullBelow () && (iNode->getDepth () < node.getDepth ()))
|
while (!iNode->isLeaf () && !iNode->isFullBelow () && (iNode->getDepth () < node.getDepth ()))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user