Some cleanups.

Add functions that avoid an allocate/copy/free where that's not needed.
This commit is contained in:
JoelKatz
2011-11-23 12:50:05 -08:00
parent 451b719ffc
commit 17c265ee24
2 changed files with 51 additions and 15 deletions

View File

@@ -229,8 +229,16 @@ public:
// normal hash access functions
bool hasItem(const uint256& id);
bool delItem(const uint256& id);
bool addItem(SHAMapItem::pointer item);
SHAMapItem::pointer getItem(const uint256& id);
bool addItem(const SHAMapItem& i);
bool updateItem(const SHAMapItem& i);
SHAMapItem getItem(const uint256& id);
// save a copy if you have a temporary anyway
bool updateGiveItem(SHAMapItem::pointer);
bool addGiveItem(SHAMapItem::pointer);
// save a copy if you only need a temporary
SHAMapItem::pointer peekItem(const uint256& id);
// traverse functions
SHAMapItem::pointer firstItem();