mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-25 21: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::ref SHAMap::checkCacheNode(const SHAMapNode& iNode)
|
||||
SHAMapTreeNode::pointer SHAMap::checkCacheNode(const SHAMapNode& iNode)
|
||||
{
|
||||
boost::unordered_map<SHAMapNode, SHAMapTreeNode::pointer>::iterator it = mTNByID.find(iNode);
|
||||
if (it == mTNByID.end())
|
||||
return no_node;
|
||||
return SHAMapTreeNode::pointer();
|
||||
it->second->touch(mSeq);
|
||||
return it->second;
|
||||
}
|
||||
@@ -175,7 +173,7 @@ SHAMapTreeNode::pointer SHAMap::walkTo(const uint256& id, bool modify)
|
||||
}
|
||||
}
|
||||
if (inNode->getTag() != id)
|
||||
return no_node;
|
||||
return SHAMapTreeNode::pointer();
|
||||
if (modify)
|
||||
returnNode(inNode, true);
|
||||
return inNode;
|
||||
|
||||
@@ -355,7 +355,7 @@ protected:
|
||||
std::stack<SHAMapTreeNode::pointer> getStack(const uint256& id, bool include_nonmatching_leaf, bool partialOk);
|
||||
SHAMapTreeNode::pointer walkTo(const uint256& id, bool modify);
|
||||
SHAMapTreeNode* walkToPointer(const uint256& id);
|
||||
SHAMapTreeNode::ref checkCacheNode(const SHAMapNode&);
|
||||
SHAMapTreeNode::pointer checkCacheNode(const SHAMapNode&);
|
||||
void returnNode(SHAMapTreeNode::pointer&, bool modify);
|
||||
void trackNewNode(SHAMapTreeNode::pointer&);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user