Avoid some extraneous reference count operations.

This commit is contained in:
JoelKatz
2012-12-14 10:10:52 -08:00
parent bc3f641373
commit 0da30fc82e
2 changed files with 32 additions and 28 deletions

View File

@@ -347,9 +347,9 @@ protected:
void dirtyUp(std::stack<SHAMapTreeNode::pointer>& stack, const uint256& target, uint256 prevHash);
std::stack<SHAMapTreeNode::pointer> getStack(const uint256& id, bool include_nonmatching_leaf, bool partialOk);
SHAMapTreeNode::pointer walkTo(const uint256& id, bool modify);
SHAMapTreeNode::ref walkTo(const uint256& id, bool modify);
SHAMapTreeNode* walkToPointer(const uint256& id);
SHAMapTreeNode::pointer checkCacheNode(const SHAMapNode&);
SHAMapTreeNode::ref checkCacheNode(const SHAMapNode&);
void returnNode(SHAMapTreeNode::pointer&, bool modify);
void trackNewNode(SHAMapTreeNode::pointer&);
@@ -396,16 +396,16 @@ public:
bool addGiveItem(SHAMapItem::ref, bool isTransaction, bool hasMeta);
// save a copy if you only need a temporary
SHAMapItem::pointer peekItem(const uint256& id);
SHAMapItem::pointer peekItem(const uint256& id, SHAMapTreeNode::TNType& type);
SHAMapItem::ref peekItem(const uint256& id);
SHAMapItem::ref peekItem(const uint256& id, SHAMapTreeNode::TNType& type);
// traverse functions
SHAMapItem::pointer peekFirstItem();
SHAMapItem::pointer peekFirstItem(SHAMapTreeNode::TNType& type);
SHAMapItem::pointer peekLastItem();
SHAMapItem::pointer peekNextItem(const uint256&);
SHAMapItem::pointer peekNextItem(const uint256&, SHAMapTreeNode::TNType& type);
SHAMapItem::pointer peekPrevItem(const uint256&);
SHAMapItem::ref peekFirstItem();
SHAMapItem::ref peekFirstItem(SHAMapTreeNode::TNType& type);
SHAMapItem::ref peekLastItem();
SHAMapItem::ref peekNextItem(const uint256&);
SHAMapItem::ref peekNextItem(const uint256&, SHAMapTreeNode::TNType& type);
SHAMapItem::ref peekPrevItem(const uint256&);
// comparison/sync functions
void getMissingNodes(std::vector<SHAMapNode>& nodeIDs, std::vector<uint256>& hashes, int max,