mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Fix one bogus and one questionable use of 'reserve'
This commit is contained in:
@@ -80,8 +80,6 @@ HashedObject::pointer HashedObject::retrieve(const uint256& hash)
|
||||
std::string type;
|
||||
uint32 index;
|
||||
std::vector<unsigned char> data;
|
||||
data.reserve(8192);
|
||||
|
||||
{
|
||||
ScopedLock sl(theApp->getHashNodeDB()->getDBLock());
|
||||
Database* db = theApp->getHashNodeDB()->getDB();
|
||||
|
||||
@@ -17,7 +17,7 @@ CKey::pointer PubKeyCache::locate(const NewcoinAddress& id)
|
||||
sql.append(id.humanAccountID());
|
||||
sql.append("';'");
|
||||
std::vector<unsigned char> data;
|
||||
data.reserve(65); // our public keys are actually 33 bytes
|
||||
data.resize(66); // our public keys are actually 33 bytes
|
||||
int pkSize;
|
||||
|
||||
{ // is it in the database
|
||||
@@ -25,7 +25,7 @@ CKey::pointer PubKeyCache::locate(const NewcoinAddress& id)
|
||||
Database* db=theApp->getTxnDB()->getDB();
|
||||
if(!db->executeSQL(sql) || !db->startIterRows())
|
||||
return CKey::pointer();
|
||||
pkSize=db->getBinary("PubKey", &(data.front()), data.size());
|
||||
pkSize = db->getBinary("PubKey", &(data.front()), data.size());
|
||||
db->endIterRows();
|
||||
}
|
||||
data.resize(pkSize);
|
||||
|
||||
Reference in New Issue
Block a user