mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-27 22:45:52 +00:00
Remove some premature optimizations.
This commit is contained in:
@@ -141,13 +141,11 @@ void SHAMap::dirtyUp(std::stack<SHAMapTreeNode::pointer>& stack, const uint256&
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const SHAMapTreeNode::pointer no_node;
|
SHAMapTreeNode::pointer SHAMap::checkCacheNode(const SHAMapNode& iNode)
|
||||||
|
|
||||||
SHAMapTreeNode::ref SHAMap::checkCacheNode(const SHAMapNode& iNode)
|
|
||||||
{
|
{
|
||||||
boost::unordered_map<SHAMapNode, SHAMapTreeNode::pointer>::iterator it = mTNByID.find(iNode);
|
boost::unordered_map<SHAMapNode, SHAMapTreeNode::pointer>::iterator it = mTNByID.find(iNode);
|
||||||
if (it == mTNByID.end())
|
if (it == mTNByID.end())
|
||||||
return no_node;
|
return SHAMapTreeNode::pointer();
|
||||||
it->second->touch(mSeq);
|
it->second->touch(mSeq);
|
||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
@@ -175,7 +173,7 @@ SHAMapTreeNode::pointer SHAMap::walkTo(const uint256& id, bool modify)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (inNode->getTag() != id)
|
if (inNode->getTag() != id)
|
||||||
return no_node;
|
return SHAMapTreeNode::pointer();
|
||||||
if (modify)
|
if (modify)
|
||||||
returnNode(inNode, true);
|
returnNode(inNode, true);
|
||||||
return inNode;
|
return inNode;
|
||||||
|
|||||||
@@ -355,7 +355,7 @@ protected:
|
|||||||
std::stack<SHAMapTreeNode::pointer> getStack(const uint256& id, bool include_nonmatching_leaf, bool partialOk);
|
std::stack<SHAMapTreeNode::pointer> getStack(const uint256& id, bool include_nonmatching_leaf, bool partialOk);
|
||||||
SHAMapTreeNode::pointer walkTo(const uint256& id, bool modify);
|
SHAMapTreeNode::pointer walkTo(const uint256& id, bool modify);
|
||||||
SHAMapTreeNode* walkToPointer(const uint256& id);
|
SHAMapTreeNode* walkToPointer(const uint256& id);
|
||||||
SHAMapTreeNode::ref checkCacheNode(const SHAMapNode&);
|
SHAMapTreeNode::pointer checkCacheNode(const SHAMapNode&);
|
||||||
void returnNode(SHAMapTreeNode::pointer&, bool modify);
|
void returnNode(SHAMapTreeNode::pointer&, bool modify);
|
||||||
void trackNewNode(SHAMapTreeNode::pointer&);
|
void trackNewNode(SHAMapTreeNode::pointer&);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user