mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Fix a few more cases where we create a new shared pointer just to
immediately throw it away, resulting in a wasted allocate/increment/decrement/free.
This commit is contained in:
@@ -210,7 +210,7 @@ RippleState::pointer Ledger::accessRippleState(const uint256& uNode)
|
||||
return boost::make_shared<RippleState>(sle);
|
||||
}
|
||||
|
||||
bool Ledger::addTransaction(Transaction::pointer trans)
|
||||
bool Ledger::addTransaction(const Transaction::pointer& trans)
|
||||
{ // low-level - just add to table
|
||||
assert(!mAccepted);
|
||||
assert(trans->getID().isNonZero());
|
||||
@@ -257,7 +257,7 @@ uint256 Ledger::getHash()
|
||||
return(mHash);
|
||||
}
|
||||
|
||||
void Ledger::saveAcceptedLedger(Ledger::pointer ledger)
|
||||
void Ledger::saveAcceptedLedger(const Ledger::pointer& ledger)
|
||||
{
|
||||
static boost::format ledgerExists("SELECT LedgerSeq FROM Ledgers where LedgerSeq = %d;");
|
||||
static boost::format deleteLedger("DELETE FROM Ledgers WHERE LedgerSeq = %d;");
|
||||
|
||||
Reference in New Issue
Block a user