Improve levelDB performance by eliminating GetHex calls and allocate/copy/free cycles.

Sorry, this invalidates existing levelDB databases. Please remove them.
This commit is contained in:
JoelKatz
2013-04-26 13:53:26 -07:00
parent 1605a74864
commit d508bba147
2 changed files with 21 additions and 17 deletions

View File

@@ -37,6 +37,9 @@ public:
HashedObject(HashedObjectType type, uint32 index, const std::vector<unsigned char>& data, const uint256& hash) :
mType(type), mHash(hash), mLedgerIndex(index), mData(data) { ; }
HashedObject(HashedObjectType type, uint32 index, const unsigned char *data, int dlen, const uint256& hash) :
mType(type), mHash(hash), mLedgerIndex(index), mData(data, data + dlen) { ; }
const std::vector<unsigned char>& getData() const { return mData; }
const uint256& getHash() const { return mHash; }
HashedObjectType getType() const { return mType; }